Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
B

boylucky

@boylucky
About
Posts
23
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • 4MHz bootloaders
    B boylucky

    Looks I succeed. I had to change the LOW fuses to correct value. I modified the APM Optiboot bootloader to accept 4MHz external oscilator. Here is the correct settings which need to be add to the boards.txt file:

    ##############################################################
    
    apm96_4MHz.name=APM Optiboot external 4MHz noBOD 38400baud
    
    apm96_4MHz.upload.tool=avrdude
    apm96_4MHz.upload.protocol=arduino
    apm96_4MHz.upload.maximum_size=32256
    apm96_4MHz.upload.speed=38400
    apm96_4MHz.bootloader.tool=avrdude
    apm96_4MHz.bootloader.low_fuses=0xfd
    apm96_4MHz.bootloader.high_fuses=0xde
    apm96_4MHz.bootloader.extended_fuses=0x07
    apm96_4MHz.bootloader.path=optiboot_v50
    apm96_4MHz.bootloader.file=atmega328_1a_4MHz.hex
    apm96_4MHz.bootloader.unlock_bits=0x3F
    apm96_4MHz.bootloader.lock_bits=0x2F
    apm96_4MHz.build.mcu=atmega328p
    apm96_4MHz.build.f_cpu=4000000L
    apm96_4MHz.build.core=arduino
    apm96_4MHz.build.variant=standard
    
    ##############################################################
    

    I had to change following lines:
    apm96_4MHz.upload.speed=38400
    apm96_4MHz.bootloader.low_fuses=0xfd
    apm96_4MHz.build.f_cpu=4000000L

    I also changed the file name to: apm96_4MHz.bootloader.file=atmega328_1a_4MHz.hex but the file is exactely the same as the original one. I also changed the name in the beginning of each line.

    Currently looks it is working well. I will add more info later if all runs ok after some testing.

    And here is also nice FUSES configurator.

    Development

  • 4MHz bootloaders
    B boylucky

    Actually the capacitance of the battery is not a problem for now. The time of wake up intervals and listen period can be changed. What I need to solve is the 4MHz bootloader.

    Development

  • 4MHz bootloaders
    B boylucky

    Yes, I need the serial communication also during the operation of the chip. That is the reason why I want to switch to 4MHz. The node is in sleep mode for 8 seconds. Then it wake up for 500ms to listen if any communication is received on NRF24L01+. Then also every 15 minutes, the node is transfering received data from NRF24 to Sigfox backend (6 sensors values in one message) via LoRa module. Currently I tested 11 days running on 1MHz without problem. The voltage drop after this 11 days is about 0,3V. So on 2AA NiMH bateries it should last for about 1 month without bateries charging. There is required serial communication between ATMEGA328P and Sigfox. That is the reason for 4MHz.

    Development

  • 4MHz bootloaders
    B boylucky

    You are right it looks like a good solution for such project. But I wanted to keep the project running on AA NiMH bateries as for me it is safe way let's say :relaxed: As I do not have any experiences with LiFePO4 and also no charger for them. But I should start focus also on such power supply in the future. Anyway, like you said it is a bit different topic :relaxed: but thanks anyway for your reply.

    Development

  • 4MHz bootloaders
    B boylucky

    For me it looks like the best solution when I want to run the node for 2AA batteries without power regulator. As the spec of ATMEGA328P is that with 4MHz it can run from 1.8V. Which is exactely 2AA NiMH bateries at the end of the capacity. Then I also do not want to use 1MHz internal oscilator as it makes sometimes troubles when serial communication is used. So that is the reason for 4MHz node.

    Development

  • 4MHz bootloaders
    B boylucky

    Hi all,
    I would like to ask you about 4MHz bootloaders for ATMEGA328P. I make a project where I want to use ATMEGA328P running on 4MHz with external oscilator. Is there any possibility how to convert bootloaders to 4MHz? Or are there any already created? Currently I was using mostly APM Optiboot internal 1MHz noBOD 9600 BAUD bootloader. Would be there possibility to convert it to 4MHz external?

    Here is info about the APM Optiboot bootloader if needed.

    But anyway, it can be any other bootloader which would be converted to 4MHz.

    Thanks.

    Development

  • MQTT vs Serial Gateway
    B boylucky

    Hi all,
    I am sory for this stupid question but I still do not understand correctly the MQTT. Currently I build my first mysensors network with SerialGateway connected to RPi with Domoticz and it is working ok. I was just wondering what is the MQTT gateway good for and what are the differences and advantages when compared with SerialGateway. Does MQTT gateway affect only the communication between Controller (RPi with Domoticz) and MQTT gateway or it also have impact on the Gateway and nodes communication? Is the whole system more stable with MQTT or what is it good for in comparison with serial gateway.

    Thanks in advance for your explanation.

    General Discussion

  • Serial Gateway + NRF24 with sleep mode enabled there
    B boylucky

    @wikibear - no problem :slightly_smiling_face:

    General Discussion

  • P2P long range communication - RFM95 with mysensors
    B boylucky

    @neverdie - by the way. Would be there some easy solution for RFM95 as a gateway? I mean following. There would be gateway or maybe better to say forwarder which would take data from NRF24 and will resend them via RFM95 to another RFM95 which would be connected to the gateway. Is there some direct way in mysensors? If not what about to have 2 nodes which would be connected via serial communication (RX and TX pins). One node would have NRF24 and second one would have RFM95. Node with NRF24 would be set as serial gateway. Then node with RFM95 would be only a simple sketch where serial communication received will be send via RFM95 as P2P communication to the gateway with RFM95 which will be then connected to internet via Wiznet 5100 for example.

    Reason why I would like to have it is the fact that the garden is without the external power source and I need to reduce it as much as possible. Then it is also far for the NRF24 to reach directly the gateway. I also want to reduce the cost of the network so I want to use mostly NRF24 as cheaper alternative.

    Hardware

  • P2P long range communication - RFM95 with mysensors
    B boylucky

    Ok, great. Thanks.

    Hardware

  • P2P long range communication - RFM95 with mysensors
    B boylucky

    ok, thanks. I will try it. Would you have some more info regarding the possible libraries and how does it work with mysensors experiences?

    By the way I already found some more comments on your page:
    https://www.openhardware.io/view/395/LoRa-Ra-01-ATmega328P-Node

    Hardware

  • P2P long range communication - RFM95 with mysensors
    B boylucky

    I would like to ask you regarding P2P LoRa modul - RFM95 or some other. I need to create P2P communication between far points (in first case about 400 meters in urban area, NRF24l01+ was not sufficient as there are trees and buildings between these points; in second case about 10 km far in unoccupied area). So I was thinking to do it with RFM95 module and arduino. I see there is many modules on the ebay. Would you have any advice which one to select? It need to operate in EU so 868 MHz. + What library then to use. I plan to use it with 2AA batteries.

    Thank you in advance for your help.

    Hardware

  • does MySensors use a guaranteed transport protocol or a best effort ?
    B boylucky

    @mfalkvidd and @hek - ok, thanks for this info :) I did not know that as I am new in mysensors. Good to know that it is already implemented in mysensors.
    Thanks.

    General Discussion

  • does MySensors use a guaranteed transport protocol or a best effort ?
    B boylucky

    @dualarrow - what about to try implement a mechanism that would send the same message which was received by the controller or better by the gateway back to the node. Then the node would check if such message received and the node will be sure that the message arrived or in your question vice versa (node would send the message back to the gateway).

    General Discussion

  • Serial Gateway + NRF24 with sleep mode enabled there
    B boylucky

    @wikibear - what do you mean exactely? If you mean to use it for specific time communication (gateway and sensor will know the exact time when to comunicate) then it is not suitable as the timer in the arduino is not that accurate. It would require to have real time chip included in both devices. It would not be a problem for the gateway but to have it in each sensor, it could make everything more expensive. So I prefere the way I am trying to do. Sensor will send data about every 15 minutes and the gateway will be on for 500ms after 8 seconds of sleep. During those 500ms it will check if the sensor is trying to send data, and if so then it will stay awake until the communication is done. Of course, the sleep and wake perion can be change, depend on the requirements (number of sensors and update periods of the sensors).

    General Discussion

  • Serial Gateway + NRF24 with sleep mode enabled there
    B boylucky

    I have set MY_PARENT_NODE_IS_STATIC, MY_PARENT_NODE_ID, and perhaps MY_PASSIVE_NODE as you adviced.
    Regarding MY_TRANSPORT_WAIT_READY_MS I do not see how it could help with the sleep mode of the gateway. Can you describe more what did you mean?

    About isTransportReady (void) - I expected that when I use it it will avoid going to sleep if data are comming from NRF24 to be processed. But it did not behave this way. I used following (but tried many other modifications)

    #if defined(MY_REPEATER_FEATURE)
     while (!isTransportReady())
      {
         _process();
      }
      int8_t result = MY_SLEEP_NOT_POSSIBLE;	// default
      transportPowerDown();
      result = hwSleep(sleepingMS);
      startL();
      return result;
    #else
      uint32_t sleepingTimeMS = sleepingMS;
    

    But it happen that the gateway is going to sleep even the messages are comming. But I guess it only from the debuging of messages (maybe there is delay between the incomming messages and printing the debug output to serial).

    Regarding your advice about RF24_SET_ARD and RF24_SET_ARC - if I understand it correctly then I am not able to set a long retry period to be able to wait for the Gateway to wake up. Do you know if there is any other option how to set it there? For now I used the mentioned repeat function which is in the post above.

    Can I ask you if there is some settings which is telling to the node that it is sending ping commands to the gateway and how to disable it or use it especially for this scenarious when the node will be waiting the gateway to wake up and send the data then.

    General Discussion

  • Serial Gateway + NRF24 with sleep mode enabled there
    B boylucky

    @mfalkvidd - Only difference with Sigfox LoRaWAN and P2P LoRa is from my point of view the amount of data you can send. With Sigfox LPWAN node you are limited to 140 messages per day with max 12 bytes of payload in one message. You can send only 4 downlink messages.

    General Discussion

  • Serial Gateway + NRF24 with sleep mode enabled there
    B boylucky

    Currently LoRaWAN as Sigfox solution is used. But later on I would like to also test the LoRa for P2P communication as it would definitely suit better for such situations where garden is far from home. Till now I have no experience with P2P LoRa communication and modules.

    General Discussion

  • Serial Gateway + NRF24 with sleep mode enabled there
    B boylucky

    @gohan - I am trying to build a solution for more scenarious. For a small garden with just couple of sensors I can imagine that the LPWAN with NRF24 will be good enough. Then for bigger gardens would be better to use long range radious or some other soulutions. In my case I am about 500m from the garden. There are buildings and trees between my home and garden. I wanted to use some cheap solution. So I wanted to make it with NRF24. I tested the long range NRF24 but it was not reliable for this distance with buildings and trees between. But like I said I would like to make a project where more solutions will be available to fit more scenarious to let people re-use it.

    General Discussion

  • Serial Gateway + NRF24 with sleep mode enabled there
    B boylucky

    @mfalkvidd - thanks for your reply. I will have a look to what you suggested. Currently I solved the problem of node thinking that gateway is always on with this code on the node sketch (I used the default sketch for DHT11 sensor from mysensors and added following functions (first 2 are just to have possibility to power up and power down the DHT11 sensor from a pin, the third function to catch the gateway in the wake up mode):

    void powerUpDHT()
    {
      // power up DHT11 sensor - PIN 5
      digitalWrite(DHT_POWER_PIN , HIGH);
    }
    
    void powerDownDHT()
    {
      // power down DHT11 sensor - PIN 5
      digitalWrite(DHT_POWER_PIN, LOW);
    }
    
    
    void repeatSend(MyMessage &msg, int repeats)
    {
      int repeat = 0;
      int repeatdelay = 990;
      boolean sendOK = false;
    
      while ((sendOK == false) and (repeat < repeats)) {
        if (send(msg)) {
          sendOK = true;
          Serial.print("ACK packet received: ");
        } else {
          sendOK = false;
          Serial.print("Repeat sending: ");
          Serial.println(repeat);
          //repeatdelay += 250;
        } 
        repeat++;
        wait(repeatdelay);
      }
    }```
    General Discussion
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular