Author Topic: Wireless programming directly from the gateway ?  (Read 1934 times)

iharobike

  • NewMember
  • *
  • Posts: 3
Wireless programming directly from the gateway ?
« on: January 20, 2016, 03:40:49 PM »
Hello,

I'm new to moteino and all the environment, but I would like to know if the following is possible.

Add wireless programming feature to the gateway with the MigthyHat and a raspberry pi 2 ?

A simple node module that reproduce the python script or GUI should work.

I think a rpi2 and a MigthyHat have all it need to archive that.

Am I wrong ?

Thanks.

iharobike

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: Wireless programming directly from the gateway ?
« Reply #1 on: January 20, 2016, 03:50:28 PM »
If I understand correctly, you want to WP a remote node, directly through the MightyHat instead of an additional separate WP programmer Moteino, correct?
This is possible, and perhaps something I will look more into. However with the current code it would significantly increase the sketch size of the MightyHat which may mean it will no longer fit in the atmega328p memory, if all the other features of the MightyHat sketch are enabled.

Generally I would advise to use a separate WP programmer Moteino until an 'official' solution is reached, since it would keep away from interfering with the rest of the network. If you use the MightyHat/gateway for programming, all other data will be blocked, although it may not be a real problem, but worth mentioning.

To achieve this feature, I would need to bridge a way to compile the sketch, transfer it to the gateway, and then to WP the target node.
Perhaps a new UI page in the gateway interface, where a file (the HEX) could be uploaded and then show the WP progress right there. The interface and gateway.js app would need to implement the equivalent of what the current windows WP GUI does.
So a lot of work but thanks for asking, definitely something to consider.

iharobike

  • NewMember
  • *
  • Posts: 3
Re: Wireless programming directly from the gateway ?
« Reply #2 on: January 21, 2016, 08:53:19 AM »
Thanks for the answer.

That exactly what I was thinking of.

If we don't want to miss data while we use wireless programming, an alternative is to use the i2c port of the rpi2 and a separate moteino. Some code have to be written but it should work.

What would be the best integrated version of the MigthHat with wireless programming features ?

- Add a separate (mini) atmega only for the wireless programming ?
- Used a big atmega to accomodate all the situation ?

Do you have a thread, request features, in the forum ? I can't find any. If not it would be cool.

You will put the wireless programming code on github ?

Thanks again for the moteino :)

iharobike

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: Wireless programming directly from the gateway ?
« Reply #3 on: January 21, 2016, 09:06:06 AM »
The bottleneck is the radio, not the atmega. To my pleasant surprise, the atmega328 can handle a lot of stuff, even with the apparently limited IO and memory, as shown in the MightyHat board. I considered using an atmega1284p but it was going to be more expensive, maybe $10 more.
Unless the WP feature is bundled in the existing MightyHat, there is no point in trying to add another atmega to it, in that case its easier to just do it separately, as I do it now.
If I develop this integrated WP then i will post the code online of course. Any communications would be halted while WP is in progress, there is no way around that, since the WP is done on a different frequency from the rest of the network. It can take up to 30 seconds or maybe more to complete it, so not a huge deal, maybe some data is lost but probably not crucial. Also when someone does do it, they are in control of the network and know what to expect. It's not like you are doing WP while the home is secured and someone is breaking in your home, and your motion sensors are expected to report motion ... :) it is assumed that you do WP in a controlled manner so I think the tradeoff of possibly losing some data is perfectly acceptable.

iharobike

  • NewMember
  • *
  • Posts: 3
Re: Wireless programming directly from the gateway ?
« Reply #4 on: January 21, 2016, 10:34:41 AM »
Sorry I was referring to the wireless programming GUI code on github, not only the exe.

Thanks.

iharobike

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: Wireless programming directly from the gateway ?
« Reply #5 on: January 21, 2016, 11:18:12 AM »
Sure, everything would be posted. The exe windows GUI would still be available of course anyway.