LowPowerLab Forum

Software support => Wireless Programming (aka OTA) => Topic started by: mzv72m on January 23, 2016, 10:45:02 PM

Title: WP problems
Post by: mzv72m on January 23, 2016, 10:45:02 PM
I have been working with the Moteinos for a few years now, but have not used WP.  I am now setting up a node to monitor my sump pump, which is in a crawl space.  I would prefer not to have to crawl down there if I need to make a minor change to the sketch on the node.  So I have been trying to setup and test WP while I still have the node on my bench.  Well it is not working for me.  I have read all the forum entries and blog posts on the subject and I am using the newest version of the OTA Programmer (1.2), and have updated all the libraries.  I keep receiving the error "No response from moteino programmer, is it connected to COM16?". 
Attached is a screen capture of the error.

This is probably something very simple that I am missing.  Hopefully someone more experienced with WP can point me in the right direction to find my problem.

Thanks,

Dan
Title: Re: WP problems
Post by: syrinxtech on January 24, 2016, 05:15:52 AM
Quote from: mzv72m on January 23, 2016, 10:45:02 PM
I have been working with the Moteinos for a few years now, but have not used WP.  I am now setting up a node to monitor my sump pump, which is in a crawl space.  I would prefer not to have to crawl down there if I need to make a minor change to the sketch on the node.  So I have been trying to setup and test WP while I still have the node on my bench.  Well it is not working for me.  I have read all the forum entries and blog posts on the subject and I am using the newest version of the OTA Programmer (1.2), and have updated all the libraries.  I keep receiving the error "No response from moteino programmer, is it connected to COM16?". 
Attached is a screen capture of the error.

This is probably something very simple that I am missing.  Hopefully someone more experienced with WP can point me in the right direction to find my problem.

Thanks,

Dan

Are you running the updated OTA gateway code on the Moteino you have connected to your laptop?  Since Felix updated the OTA programmer, HEX libraries and the gateway software, just make sure you're running the latest version of all 3.
Title: Re: WP problems
Post by: mzv72m on January 24, 2016, 10:06:54 AM
Everything should be at the current version:
  - OTA Programer v1.2
  - Moteino connected to laptop using the most current WPG sketch
  - All Libraries updated especially WirelessHEX69
  - Also updated the remote moteino manually after it did not work, so its using the current versions of the libraries

I think I have another Moteino to swap out the WPG, which is the next step I am going to try (If I do have another)

Dan

Title: Re: WP problems
Post by: Felix on January 25, 2016, 01:20:06 PM
Basically it looks like your WPG moteino is simply not responding to the FLX? handshake request from the GUI.
So thats the very first thing that happens. If that doesn't work I would debug the serial connection.
Title: Re: WP problems
Post by: syrinxtech on January 25, 2016, 04:44:11 PM
Dumb question, but at what baud rate did you program the WPG Moteino?

Title: Re: WP problems
Post by: Felix on January 25, 2016, 09:08:50 PM
WP assumes 115200 which is pretty standard on all my stock sketches.
Title: Re: WP problems
Post by: mzv72m on January 25, 2016, 09:31:14 PM
Quote from: syrinxtech on January 25, 2016, 04:44:11 PM
Dumb question, but at what baud rate did you program the WPG Moteino?

I used 115200  based on the default setup.  I also tried a 2nd WPG moteino with the same  error.

Quote from: Felix on January 25, 2016, 01:20:06 PM
Basically it looks like your WPG moteino is simply not responding to the FLX? handshake request from the GUI.
So thats the very first thing that happens. If that doesn't work I would debug the serial connection.

When I get a chance I'm going to use a different usb cable and see if that solves the problem.

Thanks for the help guys,

Dan
Title: Re: WP problems
Post by: Mobsens on January 28, 2016, 01:30:17 PM
I had this situation several times and here is my short checklist to avoid problems:

1. Make sure to have your modified  Gateway and Node sketches running fine on two Moteinos  updated with your specific values on IMPORTANT 
   SETTINGS.  I usually also set TRANSMITPERIOD to 5000 to slow things down when displaying Moteino GW connected to COMport  in Serial Monitor.
   Also make sure to have added the check for wireless statement in the Node sketch.

             if (radio.receiveDone())
            {CheckForWirelessHEX(radio, flash, true);


2. Then upload latest WirelessProgramming_gateway sketch to Moteino GW making sure that IMPORTANT SETTINGS are matched to node.
    Open COM port to check in Serial monitor that GW  it is waiting for wireless programming and close Serial Monitor again.

3. Now compile modified Node sketch with Export Binary to send the hexfile to new Node folder.( works in Arduino 1.6.7)

4. Start WirelessProgramming.exe , check COM port and browse to hexfile , enter TargetID and press Start.

5. Now things usually work , maybe you have to press Start more than one time.

6. Design your own node sketches making sure that the listening loop is always running to listen for WP message.
    Take care if you use watchdog reset in your loop as loop is not running during programming period.
Title: Re: WP problems
Post by: mzv72m on January 28, 2016, 10:19:34 PM
Felix,

I see there is a new version of the OTA Programmer v1.3

Comments say 'fix bug for DEBUG mode'

So is there a debug mode for the programmer?  And if so how do you enable it?

You also mentioned to Debug the Serial Connection.  I am not really sure how to do that.

I'm a programmer (mainframe) but this is outside my area of knowledge.
Title: Re: WP problems
Post by: Westy87 on January 28, 2016, 10:56:19 PM
OK I followed the instructions to upgrade speed to 3 HEX file lines per RF packet :
1. Updated  WirelessHEX69 lib (I'm  using Codebender, so to be double sure, I put latest WirelessProgramming.zip into "Personal Libraries"
2.Uploaded latest WirelessProgramming_gateway sketch to Moteino GW (making sure that IMPORTANT SETTINGS are matched! )
3. Downloaded Wireless Programming GUI app v1.3

I get successful OTA/WP uploads at 1 line per packet only. 2lpp and 3lpp give me OUT OF SYNC: retrying...errors
Obviously, I've done something incorrectly.
Any ideas?
Title: Re: WP problems
Post by: Felix on January 28, 2016, 11:03:34 PM
@mzv72m,
Yes I just updated the WP GUI to make it work with DEBUG on.
WP Debug mode is enabled by passing true as the last parameter in the function (default is false):
CheckForSerialHEX((byte*)input, inputLen, radio, targetID, TIMEOUT, ACK_TIME, true);
That makes it more verbose.
Your WP programmer Moteino is not talking to the GUI. There's some problem with the serial connection. Make sure you pick the right serial port. Use a serial echo example to test the serial connection:
https://www.arduino.cc/en/Tutorial/SoftwareSerialExample

@Westy87,
Make sure you run the latest lib from github, the codebender stuff might be grossly out of date.
Then update your WP Gateway example (https://github.com/LowPowerLab/RFM69/blob/master/Examples/WirelessProgramming_gateway/WirelessProgramming_gateway.ino).
Title: Re: WP problems
Post by: mzv72m on January 29, 2016, 09:24:59 AM
Quote from: Felix on January 28, 2016, 11:03:34 PM
@mzv72m,
Yes I just updated the WP GUI to make it work with DEBUG on.
WP Debug mode is enabled by passing true as the last parameter in the function (default is false):
CheckForSerialHEX((byte*)input, inputLen, radio, targetID, TIMEOUT, ACK_TIME, true);
That makes it more verbose.
Your WP programmer Moteino is not talking to the GUI. There's some problem with the serial connection. Make sure you pick the right serial port. Use a serial echo example to test the serial connection:
https://www.arduino.cc/en/Tutorial/SoftwareSerialExample

Felix,

Thanks for the help. 
I did not think of using SoftwareSerial for debugging.  I will give this a try when I get home tonight.

When trying I was watching the WPG and its LED.  The LED will blink listening for something.  Then when I select Start on the OTA Programmer the LED will go dark for a second or two then the error pops up and the LED will start blinking again like its waiting on something to do again.

I will see if I can put together a SoftwareSerial debug sketch.  Just did not know how I was going to debug the serial line while using the same serial line.

Thanks again,

Dan
Title: Re: WP problems
Post by: syrinxtech on January 29, 2016, 10:00:24 AM
Has anyone gotten OTA working with the RFM69 ATC library? 

Ever since I upgraded my outdoor weather station to ATC I cannot use any form of OTA updates.  I tried using the old Python script and all versions of the Windows tool. 

All I get repeatedly is "No response from Moteino programmer....".  Yes, the serial is working.....

The LED on the programming Moteino is blinking at a fast pace and never stops.

Tried all 3 speed settings.  Different USB cables, different Moteinos.  I even added the ATC library to the WP sketch with no luck.

The first time I run the program I get a "target set error".  I run it again and then I get the "no response" error message.
Title: Re: WP problems
Post by: mzv72m on January 29, 2016, 12:35:17 PM
I will need to try WP after commenting out the ATC on the node I have been working with.  This is my first try with WP and so far it has not worked.  It will be interesting to try after disabling the ATC on the node.  Easy to do since I have not deployed it yet.
Title: Re: WP problems
Post by: Felix on January 29, 2016, 02:10:53 PM
I added RFM69_ATC to my local WirelessProgramming_gateway and WirelessProgramming_node samples.
I ran WPGUI v1.3, speed "3", worked first try.
I think the problems being reported here must be doing with the WirelessHEX69 lib being out of date.
Again here is the changeset (https://github.com/LowPowerLab/WirelessProgramming/commit/b875235aa33d9a88278f3d02973f3883329336cc) that added support for the 50% WP speed increase. Ensure you have this lib running in your IDE.
Then please try the original WP sample sketches without changes other than the radio settings. If it works with ATC it must work without it too.
Title: Re: WP problems
Post by: ssmall on January 29, 2016, 03:06:19 PM
I have 6 nodes around the house and all of them use ATC extension to the library.  I am able to WP all of my non-battery powered nodes.  Up until a few days ago I have used the python script to do this.  Once I saw the latest post on increasing the speed of WP, I couldn't resist and tried the latest version of the WP GUI.  I failed on my first attempt to use the WP GUI because I didn't update the WirelessHEX libraries.  Once I upgraded the libraries,  and recompiled the sketches I was bale to get the WP to work.  I had to use the slowest option at first because the node had the old version of the WirelessHex library.  I upgraded it a second time using the fastest option and that worked as well.

Hope this helps
Title: Re: WP problems
Post by: Felix on January 29, 2016, 03:59:26 PM
Thanks steve for taking the time to upgrade and verifying it works :)
Title: Re: WP problems
Post by: mzv72m on January 29, 2016, 05:49:13 PM
I got it to work with the example node sketch both with and without ATC.

Now I need to try my sketch for the node  and hopefully it works.  If it does then it was just a mismatch with the libraries/code.


Everything works!!!   Yea!!!!

I must have had something out of sync

Thanks Felix for putting up with someone new to the WP process.

Title: Re: WP problems
Post by: Mobsens on January 30, 2016, 04:30:57 AM
QuoteAgain here is the changeset that added support for the 50% WP speed increase. Ensure you have this lib running in your IDE.


For many it can be difficult to have to compare the sourcecodes to find out if you are using the right version.
Why not adding the time for latest update and version no in the first lines of the sourcecomments. :)
Title: Re: WP problems
Post by: Felix on January 30, 2016, 08:26:24 AM
I completely agree versioning would make things a little more clear.
I already had this in mind, but I have to figure out what's truly the best way to do it, such that I won't miss changing the versions when I do an update. Sometimes a code change is so minor it does not deserve a version change, perhaps a minor version should increase only. Once i start versioning I cannot stop :), yet another thing to worry about.
Title: Re: WP problems
Post by: Westy87 on January 30, 2016, 11:53:39 AM
Quote from: Westy87 on January 28, 2016, 10:56:19 PM
OK I followed the instructions to upgrade speed to 3 HEX file lines per RF packet :
1. Updated  WirelessHEX69 lib (I'm  using Codebender, so to be double sure, I put latest WirelessProgramming.zip into "Personal Libraries"
2.Uploaded latest WirelessProgramming_gateway sketch to Moteino GW (making sure that IMPORTANT SETTINGS are matched! )
3. Downloaded Wireless Programming GUI app v1.3

I get successful OTA/WP uploads at 1 line per packet only. 2lpp and 3lpp give me OUT OF SYNC: retrying...errors
Obviously, I've done something incorrectly.
Any ideas?
I finally got 3x speed to work. The issue was I uploaded  a zipped version of WirelessProgramming folder to Codebender Personal Libraries. Turns out when I replaced that with WirelessHex69 codebender finds it. I reckon the original problem was Codebender didn't find the library in my Personal Libraries,so it  used the outdated builtin library.

By the way Felix, is Lowpower labs no longer supporting the Codebender built-in libraries? I really like Codebender vs the Arduino IDE...
Title: Re: WP problems
Post by: Felix on January 30, 2016, 05:00:54 PM
I like codebender for several reasons but unfortunately  I cannot support any 3rd party tools if it means I have to spend the time pushing my changes to them myself every time there is a change. Just doesn't work like that.
Title: Re: WP problems
Post by: syrinxtech on January 31, 2016, 08:55:38 AM
Quote from: Felix on January 30, 2016, 08:26:24 AM
I completely agree versioning would make things a little more clear.
I already had this in mind, but I have to figure out what's truly the best way to do it, such that I won't miss changing the versions when I do an update. Sometimes a code change is so minor it does not deserve a version change, perhaps a minor version should increase only. Once i start versioning I cannot stop :), yet another thing to worry about.

Felix,

Speaking only for myself, I think versioning has caused more problems for me than all other dumb mistakes combined.  I think it would extremely helpful to have a version ID on every piece of code, script, etc. that comes out.  Something like the following:

Major.Minor.Patch = 1.0.1

or

Major.Minor.Patch(sequence) = 1.0.1(a)

Also, it would be extremely helpful to have on the main Github page a chart showing the latest version for each of the various software packages.  Alternatively, you could have just the latest version of each package on it's individual Github page.

Yes, I know it's a lot of work and generally a PITA.  I do think it would help not only the noobies but also those folks that come from a more regimented coding background where version control is a much more invasive part of the programming process.
Title: Re: WP problems
Post by: Felix on February 01, 2016, 08:47:18 AM
I could not agree more but since I only have 24h in a day, with too many responsibilities to list here, it sounds like I would need another staff/partner to manage all that :)
I think the overall gain from all this WP related updating/upgrading should be in the positive. Meaning, more WP speed, nicer GUI with more features etc.
Once people sync up their sources and the GUI and it starts to work, the pain will start to go away, i guess it's one of the gotchas that come with my freebie no strings attached software. I hope that's not perceived as a lame "leave me alone" answer. I will consider versioning for sure though. Thank you all for the feedback and understanding.
Title: Re: WP problems
Post by: syrinxtech on February 01, 2016, 08:41:46 PM
Quote from: Felix on February 01, 2016, 08:47:18 AM
I could not agree more but since I only have 24h in a day, with too many responsibilities to list here, it sounds like I would need another staff/partner to manage all that :)
I think the overall gain from all this WP related updating/upgrading should be in the positive. Meaning, more WP speed, nicer GUI with more features etc.
Once people sync up their sources and the GUI and it starts to work, the pain will start to go away, i guess it's one of the gotchas that come with my freebie no strings attached software. I hope that's not perceived as a lame "leave me alone" answer. I will consider versioning for sure though. Thank you all for the feedback and understanding.

If you figure out how you want it done and provide guidelines, I'll volunteer to help.  I often wonder how you get as much done as you do and still try to have a life outside of LowPower.  I firmly believe in "put your money where your mouth is".....so I'm offering to help.

Just tell me how and give me the tools and I'll do the versioning.

Title: Re: WP problems
Post by: Felix on February 01, 2016, 10:21:00 PM
Thanks very much for offering. I'm not sure how it could work efficiently though.
I'm afraid it might just add to the confusion if one person submits code changes and another maintains versions. Maybe Github has some tools to do that well but I am not aware. Right now Github is the version control repository. It does a good job keeping history and all that, and we can go back in time for snapshots of repositories.

I am all too used to using diff tools to compare versions of files.
Maybe that's why I don't give versioning too high of a priority.
But of course I am very aware not all people use diff tools.
A great free diff-er is WinMerge (http://winmerge.org/?lang=en) for those interested.