Author Topic: Wireless Programming 101 (or learn from my mistakes :) - (windows)  (Read 49439 times)


Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: Wireless Programming 101 (or learn from my mistakes :) - (windows)
« Reply #16 on: May 11, 2015, 08:51:37 AM »
Thanks, fixed.
As a rule of thumb you should not assume that all the examples have the same settings.
It's recommended to always double check and adapt the settings to match your hardware and network settings.

daemach

  • NewMember
  • *
  • Posts: 16
Re: Wireless Programming 101 (or learn from my mistakes :) - (windows)
« Reply #17 on: June 01, 2015, 06:56:21 PM »
I'm trying this and getting the following error:

C:\Users\Daemach\AppData\Local\Temp\build890821271615112406.tmp>C:\Python34\Python.exe wirelessprogramming.py -t 101 -f C:\Users\Daemach\AppData\Local\Temp\build890821271615112406.tmp\SoilNode_v6.cpp.hex" -s com04

  File "wirelessprogramming.py", line 57
    print " -f or -file          HEX file to upload (Default: ", HEX, ")"
                                                              ^
SyntaxError: invalid syntax

C:\Users\Daemach\AppData\Local\Temp\build890821271615112406.tmp>

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: Wireless Programming 101 (or learn from my mistakes :) - (windows)
« Reply #18 on: June 02, 2015, 07:48:06 AM »
You need python 2.7

pipegf88

  • NewMember
  • *
  • Posts: 4
Re: Wireless Programming 101 (or learn from my mistakes :) - (windows)
« Reply #19 on: June 05, 2015, 03:12:52 PM »
Hi. For those out there who still have the problem, this video explains it clearly:

http://lowpowerlab.com/moteino/#wirelessprogramming

The main problem is to find the .HEX file that is created by the Arduino IDE.

For Windows, follow: https://www.youtube.com/watch?v=cPXO8CbYlKw&feature=youtu.be

For Mac OS, open the terminal, and type echo $TMPDIR   then you should see the temporary file directory path. Copy the path, then go to the finder window, and press COMMAND + SHIFT + G. A small popup window will appear, where you will copy the path, then it should take you to the temporary folder. Save this folder in your favorites bar, because you will need the .HEX file everytime you want to program the node wireless.

The python software is compatible with OSX too.

Hope that helps you.

E.Walker

  • NewMember
  • *
  • Posts: 20
Re: Wireless Programming 101 (or learn from my mistakes :) - (windows)
« Reply #20 on: June 26, 2015, 03:51:23 AM »
Hello Guys,

I am playing with my switchmote x2 and a motenio USB, can get the wire less programming working.

On the switchmote, as soon as I put flash.initialize() the radio do not work anymore.

I went on tryin the lib example and it is the same, the python script can't get an answer from the switchmote.

Every thing else is working as intended.

What I tried :

- Download the latest RFM69
- Go to python 2.7 with the serial module
- comment (flash.initialize()) in my original program and the radio work again.
- Try the test program for wirelessprog

Any thought ?

Best regards

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: Wireless Programming 101 (or learn from my mistakes :) - (windows)
« Reply #21 on: June 26, 2015, 08:27:37 AM »
What Moteino is installed in the SwitchMote? Do you have the FLASH MEM chip on that Moteino?
What are you using the MoteinoUSB for, the programmer?

E.Walker

  • NewMember
  • *
  • Posts: 20
Re: Wireless Programming 101 (or learn from my mistakes :) - (windows)
« Reply #22 on: June 26, 2015, 12:13:00 PM »
In the switchmote I have the moteino with the flash chip (the that came with the mote). It the only one I have with the chip.
During setup I get the "SPI Flash Init OK!"

I tried either the switchmote powered by my USB / Serial programmer or directly plug to the 220ac with no difference.

I use SPIFlash flash(8, 0xEF30); //EF30 for windbond 4mbit flash
Maybe I'm wrong with the windbond ?

The other is a motenio USB and wired to my computer for the wireless programming. I puted the example programming gateway in the moteino USB.

Thank for the support

edit : the chip on the switchmote W25X40CLSNIG
W25X40CL(4M-bit) Serial Flash memories
« Last Edit: June 26, 2015, 12:16:53 PM by E.Walker »

E.Walker

  • NewMember
  • *
  • Posts: 20
Re: Wireless Programming 101 (or learn from my mistakes :) - (windows)
« Reply #23 on: June 26, 2015, 12:52:35 PM »
I need to invistigate, something is not right

This do not block the radio

flash.initialize();

This block the radio

if (flash.initialize())
Serial.println("SPI Flash Init OK!");
else
Serial.println("SPI Flash Init FAIL!");

I will keep invistigating my code

But still no handshake

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: Wireless Programming 101 (or learn from my mistakes :) - (windows)
« Reply #24 on: June 26, 2015, 01:29:39 PM »
Ok so for WP you only need the FLASH MEM in the switchmote, so you're good.
Please ensure you got the latest libs from github.

Also there's a really nice walkthrough by Luis shown on this page, maybe worth checking out. I have other videos on the topic and posts on the blog, see this link for those.

E.Walker

  • NewMember
  • *
  • Posts: 20
Re: Wireless Programming 101 (or learn from my mistakes :) - (windows)
« Reply #25 on: June 26, 2015, 01:52:11 PM »
ok, it seems to be working now

My mistakes !

=> not being able to read => "//(16 bytes of your choice - keep the same on all encrypted nodes)"
=> get the latest SPIFlash lib
=> change a little bit my code

  if ( radio.receiveDone() ) {

    CheckForWirelessHEX(radio, flash, true);
   
    if (radio.ACKRequested()) {
      radio.sendACK();
      Serial.print(" - ACK sent");
      delay(10);
    }
   
    demande_radio = *(CDE_salon*)radio.DATA;

Thanks !