Navigation

    • Register
    • Login
    • Search
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. ToSa
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    ToSa

    @ToSa

    Code Contributor

    8
    Reputation
    97
    Posts
    1738
    Profile views
    2
    Followers
    0
    Following
    Joined Last Online

    ToSa Follow
    Code Contributor

    Best posts made by ToSa

    • RE: Porting MySensors to work with the RadioHead library

      @Yveaux said:

      So, anyone still developing on RadioHead integration, or did all of you just give up? 😉

      no progress on my end - but that's rather related to the fact that this was my first week back in the office after vacation...

      I think we should do one thing first: decouple the "network layer" from the "application layer" in MySensors:

      • not having MySensors derived from RF24
      • have a "generic" interface between MySensors and the radio

      That way it would be rather easy to make use of other radios and other network topologies - could be RH or something else. I've taken a shot at that (a lot of this based on what Kolaf and Yveaux did adjusting MySensors to RH) and will provide a link once it compiles and is tested and I hope I can keep the overhead small enough to be acceptable for the gained flexibility.

      posted in Development
      ToSa
      ToSa
    • RE: Gateway-less sensors

      Independent from z-wave I like the idea to abstract the RF hardware layer - similar to a device driver that is picked at build time. The interface should be relatively simple (init / send / check if received / receive).

      posted in Hardware
      ToSa
      ToSa
    • Over the air updates

      Really really nice project !!!

      I worked on a similar setup about two years ago with different RF modules but didn't finish. Now I was about to restart and realized that the nRF24 modules are waaaaay less expensive. I just started adjusting the old code for the nRF24 modules I ordered when I found this great project. The raspberry PI for me is the way to go as I own two sitting almost idle and don't own a Vera.

      The one feature I'm missing after reading through the majority of the available documentation is over the air updates of the sensor node software. As this is one of the features I completed for my old design, I'll go ahead and try to port the bootloader and the RPi based state-less firmware server to work with the protocol and routing implemented here... if successful I'll post the results.

      If you worked already on over the air updates or you know somebody who did, please let me know and I'll focus my efforts on something else 🙂

      Tobias

      posted in General Discussion
      ToSa
      ToSa
    • RE: 2.0 Discussion: Units, sensor types and protocol

      @Zeph said:

      But suppose we DO want to go further and determine accumulation time for all nodes, even the above.
      ...
      System Time approach 1: Master Clock Broadcast to nodes
      ...
      System Time approach 2: Track accumulation times in the hub

      I'm in favor of approach 1 as well - and an optional addition to the MySensors class to keep track of time. Only specific sensor types would use this feature - interesting mainly for actuators rather than sensors:

      Let's assume you use a relay to turn on/off your garden watering while you are on vacation. The network breaks (controller or gateway or whatever node needed to relay messages).

      • If the sensor node itself knows about the time and the schedule for watering, it can turn on and off the watering itself. If there is an issue with the communication, the time would not be 100% accurate over time but still good enough.
      • If the sensor node relies completely on the controller for time and (worst case) the communication breaks just between the start watering and stop watering command you can imagine what happens...

      Knowing about the time heavily reduces the single points of failure. The protocol already covers the "request time" communication so this should be relatively easy to implement...

      • controller sends a time broadcast every e.g. 15 minutes
      • only the nodes interested in time care about it and update their internal time
      • when a node needs the current time it calculates it based on the last timestamp received, the millis() when it was received and the current millis...

      Doesn't solve the sleep issue (as long as you don't want to submit a separate "get time request" every time you wake up) but at least for sensors that are not battery powered (relay nodes in most cases are not) it's a feasible approach.

      This is probably worth a separate thread 🙂

      posted in Announcements
      ToSa
      ToSa
    • RE: Porting MySensors to work with the RadioHead library

      @Zeph said:

      I do not think it makes sense to move type (V_code) or command into the RH FLAGs. Typically when such space is reserved for the protocol in the header but not yet fully used, it's subject to change as the protocal evolves. If part of the goal is to take advantage of the maintenance and ongoing development of RH, we don't want to set up a conflict - because other users are not going to use those FLAGs our way anyway.

      From the RH documentation / the source code:

      • for Datagram FLAGS:
        A bitmask of flags. The most significant 4 bits are reserved for use by RadioHead. The least significant 4 bits are reserved for applications.
      • for Router/Mesh FLAGS:
        Optional flags for use by subclasses or application layer

      Not setting up a conflict with the RH code will be the biggest issue: the two benefits of RH are the multi radio support and the more advanced Mesh topology - which would be worth a couple of additional bytes in flash and ram - but the other reason for the big overhead is that several advanced features of the nRF24 chip are not used because they are not available in all supported chips.

      Two examples:

      • the multi-pipe capability of nRF24 would allow to filter traffic to only current address and broadcast and avoid that any other traffic ever reaches the MCU (only slightly less code but wondering if that helps with battery powered nodes).
      • the ReliableDiagram processing in code essentially duplicates capabilities that are build into the chipset as well (auto-acknowledge / autoresubmit)

      I know you are interested in getting RF69 supported but the question is how much negative impact for all the other users (with current nRF24 setup) is acceptable. That's like using the RF69 and implementing an AES encryption in code rather than using the build-in capabilities of the chip...

      posted in Development
      ToSa
      ToSa
    • RE: Over the air updates

      @Damme said:

      @ToSa I've been looking through the ota bootloader and noticed there are alot of uint16_t wich can be replaced with uint8_t.. saves 128bytes of code. Still needs ~900bytes less until 1024 words bootloader though but is makes more space for other stuff 🙂

      I'll have a look. I've taken the code from an earlier project and adjusted to MySensors - didn't review the variable types that much. I'm using CRC16 as well where CRC8 might be sufficient...

      EDIT: got it down a little from 0x0E18 to 0x0DD0 (72 bytes) changing a few loop counters from uint16 to uint8. I don't want to change type to 8bit looking at the large amount of sensors people are asking for / working on. FOr version I'm planning to keep some of these running for a long time with as little maintenance as possible. With some software improvements over time and minor version changes during development 16bit for version seems to be the better fit as well.

      posted in General Discussion
      ToSa
      ToSa
    • RE: Over the air updates

      @tekka
      That sounds great! Can you post your code (or share a pull request)? This would either allow us to free up the remaining space or to add encryption 🙂
      The only neck-breaker would be if any of the size reduction increases the risk for a bricked node that needs manual intervention (e.g. reset / power cycle etc.).

      posted in General Discussion
      ToSa
      ToSa

    Latest posts made by ToSa

    • RE: Porting MySensors to work with the RadioHead library

      I had some time today to look at the bootloader code for RFM69 modules. Got the bootloader code to a point where it appears to be working fine - but the instability of the full MySensors RFM69 code is back - the serial gateway stops receiving packets after some time and it appears that the attempt to download a firmware by the bootloader just makes this problem more obvious due to the high volume of packets...
      My prime suspect at the moment is the interrupt driven RFM69 library using a single packet buffer. As long is it's used sequentially everything should be fine but with e.g. submission or retrieval of ack messages it opens up the transceiver while the last packet was not fully processed yet potentially causing this... I'll go ahead and replace the routines in the library with the non-interrupt-driven version I coded for the bootloader just to see if this is the right place to dig deeper...

      posted in Development
      ToSa
      ToSa
    • RE: Porting MySensors to work with the RadioHead library

      RFM69 is stable now for >48h.
      The OTA bootloader version for RFM69 is in progress. I'm stuck right now where the node debug messages show that it's sending a packet but the gateway doesn't receive anything... I moved the full initialization code back in that I thought would be ok to skip but still the same behavior. Only difference to the full blown driver at this point is that I don't attach the interrupt but that should not be relevant for tx as I'm polling the interrupt register for status (ready to send / send complete etc.).

      posted in Development
      ToSa
      ToSa
    • RE: Porting MySensors to work with the RadioHead library

      I have the RFM69 setup working now with a couple of additional tweaks mainly for code optimization. Working fine for some time but stops after a few hours - I'll have a closer look the next couple of days.
      Felix added three bytes to the payload (source address / destination address / control byte) to manage the acknowledge etc. in the lowpowerlab library. For our specific needs this is redundant as the current message format in development already includes this data. The three additional bytes are not that bad though and I'd propose to leave it like that for now and reconsider when we get to the revised message format :).

      posted in Development
      ToSa
      ToSa
    • RE: Over the air updates

      @tekka
      That sounds great! Can you post your code (or share a pull request)? This would either allow us to free up the remaining space or to add encryption 🙂
      The only neck-breaker would be if any of the size reduction increases the risk for a bricked node that needs manual intervention (e.g. reset / power cycle etc.).

      posted in General Discussion
      ToSa
      ToSa
    • RE: 2.0 Discussion: Units, sensor types and protocol

      @lunarok said:

      And last point, there is actually a internal message type Reboot. This one is indicated only working for OTA bootloader. Is that true ?

      Reset and OTA bootloader are independent - but you need to set the fuse bits of the MCU to enable the watchdog for the software reset to work. This is done automatically when flashing the OTA bootloader but you can do that as well in a separate step keeping the existing bootloader (e.g. optiboot).

      posted in Announcements
      ToSa
      ToSa
    • RE: Porting MySensors to work with the RadioHead library

      @kolaf
      I've been busy with other stuff for some time but looking at the driver separation now once again. With nRF24 working (even bootloader adjusted to pick the right header files etc.) and two Moteinos at hand (Moteino RFM69W 868/915), I compiled and flashed a serial gateway and a simple temperature sensor node. Both appear to work fine looking at the debug messages except the fact that they don't listen to eachother. Both are sending but none is receiving anything (2m distance).
      I did not touch or even closely look at the RFM69 driver code yet but will try to do so over the weekend. Do you have any hint where to check first?

      posted in Development
      ToSa
      ToSa
    • RE: Over the air updates

      @gregl the fuses determine how much space is reserved for the bootloader. I don't have the datasheet at hand but I think it varies from .5k to 4k. Optiboot is one of the smallest out there and the OTA bootloader consumes the full space because it needt to includs the (shrinked) wireless driver.

      posted in General Discussion
      ToSa
      ToSa
    • RE: Custom board with ATmega328 and crystal (or not)

      @marceltrapman I'm running almost all of my nodes (+gateway) using custom ATmega328 setup vs. using an Arduino (quite a few of them just on a breadboard for now). I did not try without a crystal. At the end you need to look at which operation is most time critical. Usually these are communication but SPI is not that time critical with the clock signal being generated by the MCU itself. I don't know for sure about e.g. one-wire if you want to use a DS18B20 or so. If you want a time aware sensor you probably should go with a crystal to get at least a little accuracy 🙂
      For power consumption you should carefully check. I guess the ATmega based on the fuses turns on or off the internal clock - you might lose some of the lower power consumption again because now the ATmega itself consumes more...

      posted in Hardware
      ToSa
      ToSa
    • RE: Porting MySensors to work with the RadioHead library

      @kolaf said:

      maybe because I already have a fork of the main mysensors repository?

      yes - Git doesn't allow two forks with the same base name (Arduino) for one user. We are about to move the changes into the mysensors/development branch. That way you can pick it up from there...

      posted in Development
      ToSa
      ToSa
    • RE: Arduino & CC3000 Wifi & NRF24L01+ over SPI

      or a WLAN Gateway 🙂

      posted in Hardware
      ToSa
      ToSa