Tuesday, February 2, 2016

Programming the ICOM M710 with DIY CI-V

Success and failure...USB-TTL to ICOM M710 programming cable

I need to reprogram my I-COM M710 Marine SSB/HAM HF rig. I have been using it aboard my sailboat since it was new in 2006 with an older Pactor IIe.

I would like to play with WinMOR and soundcard modem and some of the digital modes.

I searched the Internet and found most people were making (8 years ago) clones of the ICOM interface OPC-478.

So I first made clone cable like the CI-V cable  with  dual 2N2222s, a diode, some resisters and a DB9 connector. It needed to be plugged into my current laptop with a USB-serial adapter/emulator.  It failed. I must have put a transistor in backwards or something. Then I found the ICOM software. The software for cloning and configuring the M710 seems to be EX1726.exe (for 710RT use ES2144.exe) for DOS. It does direct manipulation of the serial port register so a PC with an real DB9 serial port running DOS, not Windows, would be required. I do not have these.

I kept searching.

I next found web page that says the ICOM clone port is TTL open collector, just one wire. And also elsewhere found the clause, "NMEA 0183 sentences at 4800 baud".

And a note describing how to make a clone cable from a USB-TTL adapter, commonly used to program Arduinos, and a phone plug.


   connect tip of mono phone plug to Rx and Tx soldered together and ring to ground of a USB to TTL serial adapter. I used a PL2303 based 5 pin adapter.


Mine shows up in syslog as:

Feb 2 14:50:18 nav3 kernel: [27157.768171] usb 1-4.4: Manufacturer: Prolific Technology Inc.
Feb 2 14:50:18 nav3 kernel: [27157.768585] pl2303 1-4.4:1.0: pl2303 converter detected

The user  belizesailor at Cruiser Forum says the DosBox emulator for games emulates the serial port so well that the ICOM software will work.

OK! I quickly made the cable for the USB-TTL adapter in the photo. Then downloaded DosBox from www.dosbox.com, for debian to my ubuntu 15.10 system.

I actually used the synaptic package manager and checked the box to include dependent packages from the repository. It worked fine. All this after a failed attempt to download the source tar ball and compile it myself. And I had also tried to install the packages on WinXP, but I have no XP driver for the Prolific USB.

Then found EX1726.zip at http://ea4yx.jimdo.com/software-radioaficionados/control-equipos/software-icom/

After unzip'ing it, edit the config file ~/.dosbox/dosbox-0.74.conf
 to set the serial ports to emulate, these two lines:
 
serial1=directserial realport:ttyUSB0
serial2=directserial realport:ttyUSB1


So to program the M710 from Ubuntu-Gnome 15.10, select:
Menu> Games> DosBox

Then in DosBox:


Z:\> mount c ~/Data/Radio/EX1726

Z:\> C:

c:\>  ex1726 /expert       # see the README maybe called M710.DOC

ESC > Clone > Rs232 >port2    # ttyUSB1

ESC > C > T   # read from transceiver to PC

....





Thursday, January 14, 2016

A New Laptop

Another laptop bites the dust.

(Updated Jan 31)

A few months ago my oldest laptop died an unnatural death. It was an Acer Aspire One about 6 years old.

I finally got tired of the other one freezing and complaining, so I went to town(Cebu, PH) and found a replacement. I had had good luck with the cheap Aspire Ones, so I just picked the best one Acer had in the market here.

Acer V3 15inch i7 8Gb 1Tb 2.4Ghz  -  V3-547G-77P6

It came with Windows 10 64bit. The hardest part about that was the decision of which Linux distribution to dual-boot with it. The Internet here is terribly slow, so the choice was limited, one year old LinuxMint 17.1 64bit, Ubuntu 14.04 32bit or Ubuntu 15.10 64bit.

It seems Windows 10 insists on EUFI type BIOS for boot configuration and boot loader. After a couple weeks I had upgraded the "BIOS" to the latest rev on Acer's support site, learned to select the next boot device from in Windows 10 menus, almost worn out the install media, re-partitioned the disk several ways and had working 14.04 and 15.10 on separate partitions alongside Windows.

The Acer barely acknowledges the F2(BIOS) and F12(boot order) soft-keys during post. After finding the Windows command to go to boot menu things got a lot less frustrating. Click Power then hold shift and click reboot for the F2 BIOS menu during boot, or pick the file to boot on the next power up.

I tried installing with the BIOS set to ignore EUFI, but then Windows10 would not boot.

The final answer is to upgrade the BIOS(to v1.31) from the default(v1.25) so it can boot a linux. Then install with EUFI enabled to secure mode and grub in the EUFI partiton, then in the BIOS set the grub file to be trusted, and there also set the boot order of the EUFI systems. Setting the boot order in Linux (efibootmgr -o 4,1 ) or in Windows 10 does not work.

I spent the next couple weeks doing all that system admin I had nearly forgotten. I installed VMware and VirtualBox. Then WindowsXP, Andy's HAM Radio, LinuxMint17.1-64bit as virtual machines. I also attempted to visualize the old Acer Aspire Windows 7 and LinuxMint physical drives into VMware, but got sidetracked about the time I realized I needed to do it from VMware instance installed in a Windows host OS.


THEN THE ACER V3 DIED!!!!

I took it to the local Acer repair/warranty center in Cebu. Tomorrow I am to get it back and have the notes to correct the above procedures.

Monday, December 28, 2015

More NMEA Bridge modules

I finally got around to testing the last 2 WiFi Bridge boards. Neither worked at first. I wasn't sure of anything.

I chose one board and went through the entire regression. When I finally got the scope (Xprotolab) out and followed the NMEA signal in, I found a broken trace. The input to the first resistor. Arg! Then I discovered I put the transistor in backwards in both boards.

But now they are both installed and broadcasting. The first is connected to the builtin Garmin GPS and depth finder data, wire-or'd on the same terminal strip at 4800 baud. And the second is connected to the AIS at 38400 baud.

Then I etched two more boards, but haven't drilled or populated them yet.

Sunday, November 1, 2015

Two More NMEA WiFi Bridge Boards

If I could only learn to take good photos
I etched two more of the NMEA WiFi Bridge boards. After only a week of messing with the layout in Eagle, I finally decided I had a valid rev x.3. It seems I left a Vcc trace off the x.2 board.

Printing the inkjet transparency went well this time, marking solid and black in eagle print, although the color came out greenish. I exposed the pre-sensitized board 1 minute 15 seconds in the 1:30 afternoon equatorial sun then immediately developed them in caustic soda from last year for about 3 minutes. Then etched in new peroxide and muriatic acid for about the same 3 minutes. They looked really nice for a change.

I then exposed them to the sun again for 2 minutes and used the caustic to get the rest of the green photo-resist off the traces so I could solder.

I tried to coat all the copper with solder, but the very fine letters just pealed off the board. I had levf a +, -,  G and Rx in copper near those pins.

It took less than 3 hours to print, etch and populate the 2 boards. Of course that doesn't count the week fussing with the layout!

I decided to leave the voltage regulator off these because I have a number of $2 Chinese buck converters that have good regulation in the 3.3v range to pair them with.

Sunday, October 18, 2015

A new board for the NMEA WiFi Bridge

I made a second strip-board copy of the NMEA WiFi Bridge. It took too long, a whole day. So I spent several days designing and etching a custom board. It only took a few minutes to populate.

I have been experimenting with taking close-up with my phone. This is looking through my 10x monocle I use to examine the boards.


The finished and corrected board with a Chinese buck DC-DC voltage converter set for 3.3 volts. After all the debugging, I left the LD1117-33 out and jumpered over it.


Maybe it assembled faster because I had left off a trace. Seems that eagle doesn't always name VCC as VCC. I put a regulator chip in the schematic, then when designing the PCB, I switched it for a different one. I inadvertently must have named it net $NS3. Well you hardly notice the little blue wire-wrap wire anyway.


I have been designing SMD  boards for the ESP-01 and ESP-12E, but haven't made them yet. I seem to have tentative requests for 4 more of these. Seems nobody likes wires to the laptop while underway.

Saturday, October 3, 2015

12 Volt LEDs for a Boat

I needed some new lights in some places on the boat. Many of the LED light strips and and clusters these days use either 12 volts or an AC adapter for 12 volts. Some even say "for car".

However on closer inspection most of these have only a current limiting resistor in series with sets of 3 LEDs. Thus they are suitable for ONLY 12 volts and below. Boats and cars are nominally 12 volts. That means they are NOT 12.0 volts. My boat runs from 12.4 to 14.4 volts depending on the state of charge of the batteries, the sun on the solor panels and whether the engine/alternator is running.

The advertised long life of LEDs is dependent on ideal conditions. The 2 main areas of abuse LEDs suffer are over temperature and over voltage.

In the tropics, the only thing I can do about the heat is by choosing how and where they are installed. They should get natural cooling of have a cooling fan.

For over voltage, what I have discovered is the LM2940T-12.0 low dropout voltage regulator. The ones I bought worked perfectly in my tests with my LEDs.

My LEDs use 20 to 40 mA each. I varied the voltage from 10.0 volts to 18.0 volts. Below 12.0 volts, the voltage out at the LED was the same as the input voltage. Above 12.0 volts the voltage stayed between 11.9 and 12.1 on my cheap multi-meter.

I used the LM2940 with no additional circuitry. Just soldered the input positive wire to Vin ground to GND of both the regulator and the LED and Vout to positive of the LED.

So far, so good.
My Chinese LED Light Tube with the LM2940 soldered inside the end. The legs straddling the end LED.

Sunday, September 20, 2015

NMEA WiFi Bridge


!! Software and library updates in github Jan 14, 2016 !!  

Updated Fritzing schematic Apr 28,16

 

The second strip-board version of my NMEA WiFi Bridge. On my boat and several others, we are running OpenCPN for navigation software. Most of us run it on a laptop. The common inputs are GPS, AIS and some have all their instruments connected as well; depth, wind, speed & distance log, etc.

There are two problems that I am trying to solve. First, too many cables to the laptop providing the instrument data. And second, a way to share the instrument data with multiple devices. The release of opencpn for android tablets and smart phones makes it feasible to have multiple displays around the boat. Like in the captain's bunk to check on crew without getting out of bed.

So this friend that wants all of the instrument data over the network has a multiplexer that takes his SeaTalk and various NMEA 0183 signals and outputs a higher baud NMEA sentence data stream. And I have a combination AIS/GPS that has NMEA 0183 at 38400 baud. My laptop is getting old and if you touch the USB cable from the RS-232-to-USB it disconnects and reconnects using a different port configuration.

And besides it would be nice to have no cables, especially to a phone or tablet.

Along comes the ESP8266 Serial WiFi module with a modest price around $2.50 USD and other board configurations for a few dollars more.

So the plan is to create new firmware for the module, connect the rs-232 based NMEA 0183 signals to it and broadcast the sentences over the WiFi as UDP packets on the local subnet. So this will require a WiFi Access-point (AP) on the boat. (ED. It may be possible for the ESP to be the router too.)  Another recent development is the availability of cheap pocket routers such as the TP-LINK WR702N. I picked mine up in Singapore for less than $8.00 USD last year, but the market is full of competitors.


The +5v power (from a 12v automobile USB charger module) comes in through the switch, upper left then a 3.3v regulator and then to the ESP module's socket. It is a little sensitive, so pull-up resistors are recommended on the 3 data lines, GPIO2 and Rx) and the chip select and reset pins. Tx and Rx are needed for programming (flashing) the firmware, and as a development board I chose to bring those to the top right pins with a ground for a future test of a 16x2 serial display. 

The NMEA 0183 from a Garmin and my AIS sort of conforms to rs-232, they are -2.9v to 2.9v. Therefore, after a little search, I found a single transistor level shifter for the Rx input to make it conform to the 3.3v TTL levels of the ESP module.

The LEDs and pins at the bottom show the state of the 2 GPIO lines. The software configuration technique uses a short between these to go into config mode. The push button puts the module in flash mode.


And the schematic of the first rev of the board. It is also the one in the fritzing project on my github site along with the code in C.



Figure 2. Schematic_v2


Parts List:
 1 - ESP8266-ESP-01
 1 - LD1117-33 regulator (any 3.3v > 500ma  will do)
 1 - 1uF tantilum
 6 - 4.7K ohm pullup resisters
 1 - 330 ohm current limit for Tx buffer
 1 - 10K ohm for rs232 level convert 1 - 2n2222 for level convert
 1 - 1N5819 program Rx input
 1 - LED
 3 - momentary pushbuttons


The design of the code has three parts.

First, short the two GPIO lines(press the config button) and turn on the power. After a few seconds (5-6)  the LED comes on indicting the module is ready to configure. It starts an AP at 10.1.1.1 that you can connect to with a WiFi capable device (laptop or phone or tablet using DHCP), then access the webpage at that IP. You get this page:






Enter the ssid and password for your boat network, the UDP port to connect and the baud rate to listen for the NMEA data.

When you click configure, it displays a confirmation of your data.
If it is correct, turn off the board, connect it to you NMEA data, remove the short between the GPIO pins and turn on the power.

The second part of the code now runs. It listens for NMEA sentences and when it has a complete sentence, broadcasts it to the broadcast address of the subnet you provided in config. All devices on that subnet can read these UDP packets.
Now go to your opencpn configuration settings, then connections. Add a new connection, selecting: network, UDP and the port number from above (default is 10110).
You should be getting data.

The third part consists of a status page. You can look in a web browser at the IP address of the NMEAWiFiBridge and get a status page that updates the number of sentences broadcast every 10 seconds. It may severely impact the ability of the ESP to keep up with a busy data stream to monitor it, so it is only there to help with trouble shooting the connections.



See my github repository for code and schematics. For faster communication, I can be contacted through my github profile (click on my user name).

The configuring software is based upon the work of Forward Computing and Control. My hardware is opensource, my software is GPL3.