Can't get OTA (aka wireless programming) to work

Started by djash40, February 17, 2017, 03:45:32 PM

djash40

I have about 4 r5 moteino's with fspi flash and I can't get wireless programming to work in linux or the windows various gui's.
I have all the new libraries install in linux and windows installed and of course first compiled them over usb.

#include <RFM69.h>         //get it here: https://www.github.com/lowpowerlab/rfm69
#include <SPI.h>
#include <SPIFlash.h>      //get it here: https://www.github.com/lowpowerlab/spiflash
#include <avr/wdt.h>
#include <RFM69_OTA.h> //get it here: https://github.com/LowPowerLab/WirelessProgramming/tree/master/WirelessHEX69


Have all that stuff.

And this part:
if (radio.receiveDone())
  {   
    CheckForWirelessHEX(radio, flash, true);
    Serial.print("Got [");
    Serial.print(radio.SENDERID);
    Serial.print(':');
    Serial.print(radio.DATALEN);
    Serial.print("] > ");
    for (byte i = 0; i < radio.DATALEN; i++)
      Serial.print((char)radio.DATA[i], HEX);
    Serial.println();
  }
  //else Serial.print('.');

but to no avail. What could I be doing wrong?
I have gateway id 1
Node id 4
output of windows program.

Available serial ports found: COM1, COM4
Opening COM4 @ 115200baud ...
SET TARGET: TO:4
Moteino: [Start wireless gateway...]FAIL: target set error, exiting...
Opening COM4 @ 115200baud ...
SET TARGET: TO:4
Moteino: [TO:4:OK]
TARGET SET OK
FLX?
FAIL: No response from Moteino programmer, is it connected to COM4?
Opening COM4 @ 115200baud ...
SET TARGET: TO:4FAIL: target set error, exiting...
Opening COM4 @ 115200baud ...
SET TARGET: TO:4
Moteino: [TO:4:OK]
TARGET SET OK
FLX?
FAIL: No response from Moteino programmer, is it connected to COM4?
Opening COM4 @ 115200baud ...
SET TARGET: TO:4FAIL: target set error, exiting...
Opening COM4 @ 115200baud ...
SET TARGET: TO:4FAIL: target set error, exiting...
Opening COM4 @ 115200baud ...
SET TARGET: TO:4
Moteino: [Start wireless gateway...]FAIL: target set error, exiting...
Opening COM4 @ 115200baud ...
SET TARGET: TO:4
Moteino: [TO:4:OK]
TARGET SET OK
FLX?
FAIL: No response from Moteino programmer, is it connected to COM4?

Is there a step by step tutorial somewhere.
I have watched louis youtube video but it's slightly outdated now.
I have also tried the other windows guis that are available.

Felix

Did you see this wireless programming guide page ?
A few good resources there...

What sketch is your gateway Moteino running?

Typically you'd have a dedicated programmer Moteino, which is the Moteino the windows program will talk to.

djash40

wireles programming gateway.
I see there is one in Examples>wireless programming OTA > called programmer.
I'll try that tomorrow!
Excited hope it works.
:D

djash40

Tried the programmer sketch and no go.

Opening COM4 @ 115200baud ...
SET TARGET: TO:4FAIL: target set error, exiting...

I think I'll try it back in linux with python command line see what happens.

djash40

python2.7 wp.py -t 4 -f WP_Node_Tank_LVL_010817.ino.standard.hex -s /dev/ttyUSB2

TO:4
Moteino: [TO:4:OK]
TARGET SET OK
File found, passing to Moteino...
FLX?

FLX?

FLX?

FLX?

No response from Moteino, exiting...

What am I doing wrong?

djash40

I just tried the example programmer and target only changing only the encryption key in both linux command line and windows wireless programing.exe and I cannot get them to work... :'(

LukaQ

Make sure, you have enough current for Moteino, my serial driver did not manage to provide enough for HW version of radio (had to add LiFePO4 battery across power). Also with HW, programming was good, if nodes were not next to each other (or did have antenna in same direction)

Felix

djash40,

I see you are you using a python program?
That will not work. You need to use the windows program. That needs to talk to a COM port which has a Moteino with the OTA programmer sketch.

djash40

A few of my tests were in a Windows 10 box I bought specifically for this wireless programming.
My many attempts failed and I'm not sure why. Could be windows 10 not sure.
I have read all the different posts on wireless programming throughout the site and cannot find a comprehensive post for the newer ota wireless programming. I did see perhaps windows 10 is not so good. Unfortunately I could not get windows 7. :(

Felix

I'm sure it's some small detail somewhere, either a setting in the sketches or something to do with how you use the setup. It sounds like you're doing everything right, and I would probably not blame it on Windows10 at this point, but I haven't tried it on W10 yet, I'm still on W7 :P

ssmall

I can confirm the OTA windows app works fine on Windows 10.

djash40

Could it be in fact too close as LukaQ suggested?
I can move the windows 10 box somewhere else as it is headless and I control it with nomachine nx.
My last attempt was with https://github.com/msjfb/Moteino-Wireless-Programming. Installed the vb stuff and the program ran fine but it too failed.

Felix

I can only support the official one :)
And it works, as confirmed by others.
A few things have to be done right, and it looks like you're on the right track, just can't see why it would fail on your end.
Sometimes sleeping over it makes a difference :)

LukaQ

What you should do/check.
Set one moteino as programmer, check that sketch matches what you have (HW/non-HW, freq.), #define FREQUENCY_EXACT the same as will be on target or
//#define FREQUENCY_EXACT
if not used.

Set other moteino as target, check that sketch matches what you have (HW/non-HW, freq.), that
CheckForWirelessHEX(radio, flash, true);
is set to true instead of false

That's about it for WP. In my case, I also try not to have it next to each other, to have enough power (I don't use moteino)

luisr320

CheckForWirelessHEX(radio, flash, true);

What is the "true" for?