Issues flashing firmware on both emonTx and emonGLCD

Hi, I'm just getting back into electronics after not having touched a soldering iron for 10 years. Santa was nice with me last year and brought me for Christmas what I had asked for in my letter to him: a full OpenEnergyMonitor kit to solder myself! But as I didn't own my own soldering iron, and because life gets in the way, I've only been able to start yesterday building the kit.

I've built the RFM12Pi (v1) and the emonTx yesterday, and the emonGLCD today. I'm pretty happy with the results, but with a minor twist: I can't get the firmware to upload to either the emonTx or the emonGLCD...

When testing both PCBs with a multimeter, I get the nice 3.3V where I'm supposed to, also 5V at the appropriate places. But when connecting with an FTDI cable (also bought in the shop here), once instructed to Upload, the Arduino IDE waits for a few seconds and then shows an orange bar with the following text:

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

Binary sketch size: 12274 bytes (of a 32256 byte maximum)
avrdude: stk500_recv(): programmer is not responding

According to the build instructions, the ATmega will come with Arduino Optiboot 4.4 bootloader (select Uno in IDE) but with no sketch uploaded. Since I can nicely upload sketches to my official Arduino Uno, I'm wondering if the bootloader is correctly flashed on the IC (assuming that one needs the bootloader to flash sketches?).

Does anyone have any idea what I should be testing next?

e2jk's picture

Re: Issues flashing firmware on both emonTx and emonGLCD

Actually I need to correct something: I was able to upload Sketches to my Uno 2 weeks ago, but when I try now I also get the same error message. I will investigate further to get the communication with the Uno working again, and will inform you of the progress.

FYI I'm using Ubuntu Linux 12.04.

e2jk's picture

Re: Issues flashing firmware on both emonTx and emonGLCD

So I changed the USB port and was able to upload the sample Blink program to the Uno, but the emonTx now returns:
avrdude: stk500_getsync(): not in sync: resp=0x00

and when I try a second time, I get the "programmer not responding" error message again

I noticed a difference between the Uno and the emonTx, they come up under a different Serial Port:

  • Uno:/dev/ttyACM0
  • emonTx: /dev/ttyUSB0

The Arduino documentation indicates that the FTDI device should show up like this in dmesg (although I don't know if that's only if you've compiled your own kernel, which I haven't)

    ftdi_sio 2-2:1.0: FTDI USB Serial Device converter detected

When I look in dmesg, when I plug in the FTDI  the following appears:

[20977.366830] usb 3-2: new full-speed USB device number 12 using xhci_hcd
[20977.384283] usb 3-2: New USB device found, idVendor=10c4, idProduct=ea60
[20977.384286] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[20977.384288] usb 3-2: Product: CP2102 USB to UART Bridge Controller
[20977.384289] usb 3-2: Manufacturer: Silicon Labs
[20977.384290] usb 3-2: SerialNumber: 0001
[20977.384932] cp210x 3-2:1.0: cp210x converter detected
[20977.550735] usb 3-2: reset full-speed USB device number 12 using xhci_hcd
[20977.567472] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8801a8776fc0
[20977.567481] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8801a8776f80
[20977.567996] usb 3-2: cp210x converter now attached to ttyUSB0

I don't see any mention of FTDI in my dmesg output, but this "cp210x converter" or "CP2102 USB to UART Bridge Controller".

e2jk's picture

Re: Issues flashing firmware on both emonTx and emonGLCD

So, I've been trying several things:

  • all 3 of my laptop's USB ports
  • directly connecting the USB-to-FTDI to the laptop instead of through the USB extension cord that was provided
  • testing with both the emonTx and emonGLCD using the Blink example sketch and the PCB's respective example sketches

But nothing seem to get me further. I'm always getting the "programmer is not responding" error, not even the "not in sync" one anymore. And uploading to the Uno works on all 3 ports.

I've also done continuity tests using my multimeter between the pins on the USB-to-FTDI and the actual components on the board, I've ruled out a faulty soldering (at least on the FTDI component, but as mentioned before I do get my 3.3 and 5V as expected). I forgot to mention that I plug the FTDI in the right sense (GND with GND, with the led facing outwards). Byt the way, is it expected that the led on the FTDI would blink when uploading? Mine doesn't blink, althoug the few times I've seen the "not in sync" error I think I've seen it lose a tiny bit of intensity (but that could be my tired eyes, it's 1:30 am now...)

I'd appreciate some help ;)

(and just in case the help involves flashing the bootloader, I'll need just a little bit more help than the ArduinoISP and the Jeelabs tutorials, as the first doesn't really show which ISP pins on the emon* boards to use, while the second shows them but I don't have access to the code, even after having created an account on Jeelabs' redmine)

Good night!

glyn.hudson's picture

Re: Issues flashing firmware on both emonTx and emonGLCD

It should like you might have a faulty programmer. Did you get it through the OpenEnergyMonitor shop? If so please drop us a line at support@openenergymonitor.zendesk.com and we'll sort out a replacement 

MartinR's picture

Re: Issues flashing firmware on both emonTx and emonGLCD

You can verify that the FTDI cable is working when it's not connected to the board by simply looping the TXD and RXD pins, typing something in a terminal window and verifying that the typing is echoed back.

e2jk's picture

Re: Issues flashing firmware on both emonTx and emonGLCD

Thanks to the idea of looping TXD and RXD, I've done a continuity check on it, and found out that the pins TXD-RXD, TXD-RTS and RXD-RTS are in closed circuit (none of the other are). i.e.when I touch 2 of those 3 pins, my multimeter beeps. Is that expected?

Robert Wall's picture

Re: Issues flashing firmware on both emonTx and emonGLCD

That is not a valid test, and means almost nothing. It very much depends on the voltage your multimeter applies to the circuit when testing continuity as to whether a semiconductor junction (of which there will be many) will show continuity or not. The manual should tell you.

e2jk's picture

Re: Issues flashing firmware on both emonTx and emonGLCD

My low end multimeter's user's manual isn't that fancy ;)

Anyway, I've connected TXD and RXD, but when running this I don't get anything returned:

$ echo test > /dev/ttyUSB0 && read -t 3 A < /dev/ttyUSB0 && echo $A

(command from the Raspberry Pi's forums, let me know if I'm not doing this correctly)

We're actually meeting tomorrow with my LUG to get our local Hackerspace started, and I've asked one of the guys to bring one of his USB-to-FTDI cables, I'll then be able to identify what goes wrong.

Thanks guys for your help!

e2jk's picture

Re: Issues flashing firmware on both emonTx and emonGLCD

I'm back from vacation, and have received the new cable. I'm glad to report that one works fine, and I was able to upload the LCD test sketch: red and green are alternating!

Thanks for your help, issue closed!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.