Showing posts with label Electronics. Show all posts
Showing posts with label Electronics. Show all posts

Wednesday, January 20, 2016

Reverse Engineering Cheap Chinese Radio Firmware TyTera MD-380 (Shmoocon 2016 via Hackaday)

Cool Stuff:

For those who are interested in the intersection of microcontrollers, hacking, and radio, an interesting deep dive into the firmware of one of the Chinese DMR/mototrbo ($140) radios, the Tytera MD380.

Unlike the cheap analog Chinese radios (Wouxun, Baofeng) which can only be programmed once, this radio supports a firmware upgrade.  The bit that is interesting for people who aren't deep into digital electronics is that this hack produced a version of the firmware that turns the MD380 into the first (hardware) DMR scanner.  N2NOV has been pointing out the gap, that no scanners cover DMR for a while now.

Note: this exploration/hack is at the experimental stage, so I wouldn't consider this ready/usable/applicable to anyone but those that want to experiment and are willing to risk bricking their radio or worse.

I couldn't resist, so I ordered a Tytera MD-380 this morning. More details to come.  So now my To Do list includes, learning about DMR/MotoTRBO, programming NYC area DMR amateur radio repeaters, and finding/joining communities that are covering alternative firmware development for the MD-380.

Out of the box, this radio is supposed to allow field programming (aka front panel programming) of DMR talkgroups.

Travis GoodSpeed's github repo, has a package of command-line Python tools for the MD380. Looks like enough for reading and writing the radio on Linux and Mac OS.  Also there is the beginnings of a CHiRP driver for the MD380. It doesn't read/write the radio but can be used for maintaining the analog channels and banks.

Also, hack-a-day, has had some good radio articles lately that aren't that deep into digital electronics for a wider audience.

You might recognize the name Travis Goodspeed from other projects like the GoodFET, an open source JTAG adapter inspired by Dangerous Prototype's Bus Pirate.

Links:


Friday, January 15, 2016

More Yaesu VX-8 GPS implementation details.

4Z7DTF left a comment on my post "Another Yaesu VX-8DR external GPS with an Arduino/..." to let me know about his VX-8 Arduino GPS project on github.

There have been a number of projects that use either an Arduino or bare ATtmega microcontroller to turn the GPS module's NMEA sentences back into the a format the brain dead parser built into the VX-8's firmware can handle.

He has done some additional testing, actually fuzzing, showing the VX-8's parser does no error checking what so ever. 

Also, another interesting bit, in his work, he noted there is no need for the communication to be bi-directional. I don't know what, if anything the VX-8 tries to send to the GPS module, but it appears to be unnecessary. 

What is interesting about that is the microcontroller then really only needs a single serial port.  Most of the other projects are bi-directional using a software UART emulation for the second port.   So it might be possible to implement this project with something much smaller and even lower power.   It would be interesting to see if this can be done with the ATTiny85, using something like the Adafruit 3.3V trinket.  That is supposed to draw around 9 milliAmps at 8 Mhz, but 3 mA of that is just for the green power LED!  The ATTiny has no built in UART, so it would be all software serial. 



Friday, August 14, 2015

Another Yaesu VX-8DR external GPS with an Arduino/ATmega328 translator.

I've collected links for a few of these projects to add a better external GPS to the Yaesu VX-8DR, instead of the somewhat proprietary Yaesu option.

Here's another one from VK3YY that got posted recently:

Here's code from DFannin on github:
Update 2016-01-15, 4Z7DTF notified me about his project, which includes more additional analysis of how poor the VX-8's parsing and error handling is.

Background Info:


Good detailed blog post Reverse Engineering the Yaesu VX-8DR GPS Interface. From Feb. 2013. He didn't arrive at the solution, which I believe F4FXL and at least one other have. But I think he's got most of the relevant details for the padding differences listed as well as some other very useful info including details on the GPS chips used in VX-8 and VX-8G.

We now know how to connect to and send a properly formatted GPS NMEA message to the Yaesu VX-8DR. Here's the summary:
  • 9600baud TTL 3.3V serial signalling, 8/N/1
    • NOT RS232 -5 to +5V signalling -- you need a level converter if that's all you have
  • 3-wire physical interface to the following pins:
    Pin GPS Side Purpose Yaesu Side Purpose
    4 GPS RX Yaesu TX
    5 GPS TX Yaesu RX
    6 GPS GND Yaesu GND
  • According to 4Z7DTF (2016-01-15), there is no need for the communication to be bidirectional. Only the TX Data from the GPS to the VX-8 is required.

The messages need to be formatted exactly as follows:

Message Type Source Sentence
$GPGGA Sample $GPGGA,123223.000,4131.2334,N,00021.1216,E,1,04,02.7,00123.4,M,0051.7,M,000.0,0000*41

Syntax $GPGGA,hhmmss.sss,llll.llll,a,yyyyy.yyyy,a,x,xx,xx.x,xxxxx.x,M,xxxx.x,M,xxx.x,xxxx*hh
$GPRMC Sample $GPRMC,123223.000,A,4131.2334,N,00021.1216,E,0000.00,291.33,301011,,*3E

Syntax $GPRMC,hhmmss.sss,A,llll.llll,a,yyyyy.yyyy,a,xxxx.xx,xxx.xx,xxxxxx,,*hh
$GPZDA Sample $GPZDA,123223.000,30,10,2011,,*55

Syntax $GPZDA,hhmmss.sss,xx,xx,xxxx,,*hh

Saturday, January 17, 2015

Better PC Sound Card Oscilloscope software (windows).

TL;DR - Visual Analyzer, PC Sound Card Oscilloscope software.  Nice spectrum analyzer.  Worth checking out.   http://www.sillanumsoft.org/prod01.htm


Through a really good YouTube Post on using an SDR for Frequency Deviation Measurement on FM transmitters I learned about Visual Analyzer. I should probably do a separate post just on this.

Previously I used Xoscope on Linux and Zeitnitz Soundcard Oscilloscope (http://www.zeitnitz.eu/scope_en).

I had also found, but not used Zelscope, Soundcard Oscilloscope and Spectrum Analyzer.

I originally got some pointers on sound card osclloscopes, from Virginia Tech's Introductory Electronics courses that were based on their Lab in a Box, so that students would have all of their own materials for doing the electronics work without having to be in a physical lab.   See:

Virginia Tech, Experiment 12, Calibrating a Sound Card Oscilloscope

I only went so far with sound card oscilloscopes, because shortly after I started experimenting, the Rigol DS-1052E oscilloscope became available within my budget.  I bought it for $400 direct from China.  The Rigol caused a little bit of a revolution in terms of oscilloscope availability and pricing.

That was all back in 2009 and 2010 when I started reading a lot more about electronics.  In December, 2009, I finally took the exams from my amateur radio license.  I passed both Technician and General with 100% and went back for the Extra Class at the next exam session.  I got one wrong on my Extra.

Of course, the interesting bit that got me here writing this today is that the RTL-SDR stick can be used as the analog (ok radio frequency) front end for a software oscilloscope, spectrum analyzer, deviation meter, etc.  Especially for those of us without much in test equipment.


Saturday, March 29, 2014

What is a dB, dBm, dBu, dBc, (Tutorial Videos from W2AEW on Youtube)

If the concept of decibels (dB) is confusing, this Youtube video from W2AEW has a very clear explanation with a demonstration using a spectrum analyzer:

https://www.youtube.com/watch?v=1mulRI-EZ80#aid=P-LGfIJuuH8

Remember: dB is a ratio of Power levels, so when you need to do a ratio of Voltages, the formula is different.  He doesn't mention that until late in the video.  However, he gives a much clearer explanation of why the formula is different (20 x Log10() vs 10 x Log10()) by doing the
math to demonstrate where the difference comes from.

(Remember P=I x E or P = (V^2)/R ?)

There is a table at the beginning of the video of the few things you should memorize both for your amateur radio test and for general use later:

  • 3 dB represents a ratio that is a doubling.  Of the two things being compared, one has twice as much power as the reference.
  • -3 dB represents a ratio that is a half.
  • 10 dB is 10 times greater.
  • 20 dB is 100 times greater.

Note: W2AEW has posted a whole bunch of good video tutorials on electronics and radio.
https://www.youtube.com/user/w2aew

A couple that might be relevant to prepping for your General Class amateur radio exam:

I've also found his oscilloscope and spectrum analyzer tutorials to be very useful.  He's very good at explaining and documenting things.  Compared to a normal text presentation, the demonstrations / experiments really drive the concepts home and show that it's possible to try these things for yourself.

Enjoy.

 

Thursday, January 2, 2014

Rigol DS1052E/DS1102 and Linux, Python, usbtmc

[To Be Updated]
This is one of those intersections of electronics, open source, hacking, and programming that really gets my interest.

Here are some links with information on connecting the Rigol scope to Linux, and controlling it using Python via USB.  The scope implements the USB test and measurement class, usbtmc.

Tuesday, December 10, 2013

Adafruit Products of particular interest to Amateur Radio DIY Projects

[hopefully I will come back and expand this post a bit later]

Adafruit.com has a few products that are of particular interest to me for amateur radio DIY projects.
These products have been well research and seem to be currently best-in-class to me. Read the product pages and tutorials on the Adafruit site to see what I mean. The projects I'm thinking about are:
  • Yaesu VX-8DR
    • DIY GPS Module with the Adafruit GPS Module.  The stock Yaesu GPS seems to be overpriced and is reported by many to underperform.  The Adafruit Ultimate GPS seems like it should do a much better job, but the VX-8 seems to have bugs in it's parser so it requires some field padding that is particular to the Yaesu GPS.
    • Bluetooth Serial Link to use an Android Phone's built-in aGPS via a serial bluetooth connection.
  • Yaesu FT-857D
    • Bluetooth Serial Link
      • Eliminate the need for the direct CAT cable connection for better isolation from the computer
      • Rig control via an Android Phone app. The FT-857's small control panel has a number of compromises. The stock radio mic doesn't have a keypad for direct frequency entry.
  • Uniden BC346XT Scanner
    • Bluetooth Serial link for logging scanner activity. Hopefully this will let me get the scanner farther away from the noise generated by the computer while still allowing me to log hits.
Hopefully I'll be back soon to log my progress.

Monday, April 9, 2012

Interfacing Radios to computer sound cards.

A question that frequently comes up on some of the various radio mailing lists I'm on is how to interface the radio to a computer for doing digital modes via the sound card. The sound card provides the equivalent of a modem, doing digital to analog and analog to digital conversion.

Skip Tellar, KH6TY, has a design called DigiVOX that was in the March 2011 QST for sound card interfacing. It will do a VOX function for activating the Push-To-Talk for doing digital modes without using any additional signaling lines.


Mark Phillips, NI2O, sells a kit called USB Digivox that combines a USB sound
card and KH6TY's digiVOX interface at his Go Box Gizmos site. This simplifies the setup and gives a dedicated sound card for the radio analog to digital and vice-versa.


Argent Data systems is a good source for a microphone/speaker cable for connecting to Kenwood, Wouxun, Puxing, and other chinese radios that emulate the Kenwood.


The software that is the most popular for doing sound card digital modes is FLdigi by W1HKJ. It can do quite a few different modes and is cross platform. It's got a lot of functionality and though has a bit of a learning curve. Fortunately there are a lot of tutorials out there on how to use FLdigi.


Note: Laptops often have a MIC input connector and not a line level input. On the ring of the MIC connector is 2-5V for biasing the microphone element. You want to take care with this, I'd at least make sure to put a capacitor to block the DC or make no connection to that side. If I remember correctly it corresponds to the Right (Red) channel.