RESOLVED: Can't load sketch to new Emontx - not in sync

Hello, and thx for an interesting site!. Just starting out on the journey - with a plan to monitor solar PV (and HW) and then later make better use of excess energy. I've read around the fourm and looked for answers, however...

I've just built an EmonTX, but just cannot get the Aduino IDE to load (any) sketch. It just reports not in sync (or usbdev_open(): did not find any USB device "usb" if I hold down shift key on upload)

Am now at a loss as to what to try next. I've tried on two different PC's (one running WIndows 7 the other XP)

PC is seeing the FTDI on Com22. FTDI is lit with blue LED (and is plugged into the board with gnd to gnd etc, i.e LED facing away from board)

I've checked the component layout to confirm i've soldered it all correctly. Can't see any obvious solder shorts etc.

On the pin holes near to the microcontroller I'm reading 3.3v between GND and 3v pin holes in all three locations + on the radio rf module. 5v on the pwr pin holes.

Any other suggestions what to try/test

Robert Wall's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

Have you loaded the serial drivers? See here: http://openenergymonitor.org/emon/buildingblocks/uploading-arduino-firmware - Step 5

langstroth2's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

Thanks for the suggestion. I had loaded the drivers. I also tried connecting via on a linux box (rasberry pi - I can upload a sketch onto a Jeelink without problems from the pi)  - same problem. So my assumption is it's the board. I'm stumped, short of replacing components on by one, not sure what else to try....

Robert Wall's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

Where did you get your FTDI from? IIRC, it needs to be the 5 V, not the 3.3 V version to work with the emonTx. If it was from the shop, it should be correct.

glyn.hudson's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

It's sounds like it could either be a driver issue or a faulty programmer. Was the programmer bought from the openenergymonitor shop? If so we would be happy to send you a replacement. Can you see an obvious problems with it visually? 

Petrik's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

I would like to report the same issue. I can not program the ATMEGA328 that arrived today.

This statement has been verified by putting another ATMEGA328 to the socket and the PCB build works as I can program another chip. Also put this one that can not program to my emonGLCD and it does not program there either.

Maybe there is a faulty batch of ATMEGA328 or the arduino bootloader is missing ? How could I verify this ?

Btw - thanks chaps for restoring the servers so rapidly !

 

Petrik's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

Yep, in my case the bootloader was missing. Programmed the bootloader and my emontx works now. I am sure one can use two emon modules like tx and glcd to transfer a bootloader if you have even one working ATMEGA328 chip but thats for someone who has read the schematics to outline

-----------------------

In my case luckily had ATMEGA2560 and Arduino UNO to use 2560 as ISP so need to do a bit of wiring and then using 2560 board to send a bootloader to chip on UNO board. This is what I did to program the bootloader

1) Compile and send sketch File/Examples/ArduinoISP to 2560 board (need to set board and com port)

2) Remove working 328 from uno board and put the ATMEGA328 without bootloader on the UNO board

3) Wire the boards like below noting that with mega 2560 pins are different

4) Tools set board to uno, programmer as arduino isp and burn bootloader. "When you get avrdude done.  Thank you." bootloader is transferred.

Below is an example of using UNO to UNO wiring

With 2560 the following pins are different:

Slave reset - destination pin 'reset', connect to source 53
MOSI - destination pin 11, connect to source 51
MISO - destination pin 12, connect to source 50
SCK  - destination pin 13, connect to source 52

 

langstroth2's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

Wow, thx for all the replies. Just back from work.

All the components were bought form the shop, including the FTDI cable and programmer. I can't see anything obviously wrong with it, thanks for the offer of a replacement Glyn - maybe trying another one would be an option to try [PM sent].

I've also tried to load from a linux build I'm fairly sure it's not a driver issue. Given some of the rexponses above it does sound as though it could be the USB CP2012 programmer module or the ATMEGA328 doesn't have a bootloader on. I'm stuck with the latter as I don't have another UNO board / ATMEGA328 to do as above post.

 

tontonsam's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

Helas,

I have to report the same issue.

Would it be possible for someone to post a comprehensive tutorial to fix this?

(as a newbee i'm very impressed with the picture tutorials, those were SUPER to follow :-))

greets

langstroth2's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

Just to update the thread. Thanks to the rapid response of Glyn (thank you), I was able to try a different Atmega328 and Programmer - and it turned out the problem was with the Programmer. The replacement worked first time - successful upload of the test blink sketch - I now have a merrily blinking LED on the board.

Now I can get started on loading the actual sketches - and I'll no doubt be back for advice. My plan is to send temp and PV/House AC current data to a raspberry pi (via RF - jeelink) on which Emoncms is running. The PI will also be used to control a set of relays connected to a standard remote plug controller - via GPIO - to switch on some AC Mains sockets (heaters) when PV geenration is > consumption.....or may be the emontx could do this?

langstroth2's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

Oh dear. Nothing else working - RF or current sensors. I think I may need a re-think.

glyn.hudson's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

What problem are you having? Can you get the simple rf tester to work? https://github.com/openenergymonitor/RFM12B_Simple

langstroth2's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

Sure I'll get the Emontx working eventually, it's proving more problematic than I envisaged. Anyway...

Yes I've tried running the Tx_simple on windows PC. No comms.

I have a JeeLink running the Rx_simple on a Rasberry Pi (both running at 868Mhz) - using arduino ide as above.

I've also tried:

- running the above the other way around (PC Rx, Rasberry Tx)

- running both nodes on the same PC (diff com ports obviously)

- adding an LED blink section to Tx and Rx  just to confirm both sketches were running (they were)

There's 3.3V at  vcc-gnd pins on the RF module. 

Any other suggestions what I need to check - how can I confirm the RF is actually operating - the above script will print to output irrespective of the module state?

langstroth2's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

Here is the emontx, in case any one can see anything obviously wrong. Not the neatest of soldering I admit - particularly as I went back over it in case a dry joint was causing the problems.

https://plus.google.com/photos/116410927319978583316/albums/5801801464461022769

tontonsam's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

Small update, 

a friend of mine tested the chip and indeed, swapping the chip from a working aduino uno board did the trick...

Petrik's picture

Re: RESOLVED: Can't load sketch to new Emontx - not in sync

If a chip swap did the work maybe its the bootloader that is missing ?

Comment viewing options

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