Navigation

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

    bach

    @bach

    4
    Reputation
    13
    Posts
    2
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online
    Location France

    bach Follow

    Best posts made by bach

    • RE: nano & E01-ML01SP4 gateway

      Hello guys,

      thank you for your intels ! i recieved the pcb and built it, it works
      i changed C1 for a 0.1µF, and removed R12
      i kept the resistor bridge for isp comm.
      i tried to activate buffer with irq but it's going rogue, gave up with that
      i doubt that the inclusion button has any utility, it seems to be just an other reset button

      It gives me a little serial gateway wich size is about the same as a "sonoff zigbee dongle plus"
      i'll have to make an enclosure for it now

      IMG_20230401_223435.jpg

      posted in My Project
      bach
      bach
    • RE: can't get aht10 working sidebyside mysensors

      i had my answer on ahtxx issue

      Hi,

      ...figured out that the _address is messed up (i guess by mysensors).

      It is impossible, because _address is private variable. The private data members cannot be accessed from outside the class (mysensors can not see it).

      Сan you try my original library but with class initialization line

      AHTxx aht10(0x38, AHT1x_SENSOR); //sensor address, sensor type

      posted in Development
      bach
      bach
    • RE: nano & E01-ML01SP4 gateway

      and some pictures

      IMG_20230317_230541.jpg IMG_20230317_230753.jpg

      posted in My Project
      bach
      bach

    Latest posts made by bach

    • RE: can't get aht10 working sidebyside mysensors

      i had my answer on ahtxx issue

      Hi,

      ...figured out that the _address is messed up (i guess by mysensors).

      It is impossible, because _address is private variable. The private data members cannot be accessed from outside the class (mysensors can not see it).

      Сan you try my original library but with class initialization line

      AHTxx aht10(0x38, AHT1x_SENSOR); //sensor address, sensor type

      posted in Development
      bach
      bach
    • RE: can't get aht10 working sidebyside mysensors

      thanks eiten,

      I arrived at the same conclusion, indeed i replaced _address by _i2cAHTAddress in AHTxx library and it works.
      I am completely new to cpp (and arduino) but not to developpement, and what bothers me it's that libraries, like mysensors and ahtxx, for example, could compete on variables. Comming from javascript where global variables are avoided i am realy suprised about that. Is this normal behaviour ? what i don't understand is that _address is a private property of AHTxx class, so it should be encapsulated, how could mysensors overwrite it ?

      posted in Development
      bach
      bach
    • RE: can't get aht10 working sidebyside mysensors

      ok, so i figured out what is going wrong, but i don't know how to solve this 😞
      more info at https://github.com/enjoyneering/AHTxx/issues/15
      if someone can help from here ...

      posted in Development
      bach
      bach
    • can't get aht10 working sidebyside mysensors

      Hello,

      i have a sketch for aht10 wich is working perfectly alone
      the library is https://github.com/enjoyneering/AHTxx

      // AHT10
      
      // https://github.com/enjoyneering/AHTxx/blob/main/examples/AHT10_Serial/AHT10_Serial.ino
      #include <Wire.h>
      #include <AHTxx.h>
      
      float ahtTemp;                               //to store T/RH result
      float ahtHumi;
      
      AHTxx aht10(AHTXX_ADDRESS_X38, AHT1x_SENSOR); //sensor address, sensor type
      
      
      
      void setup()
      {
        Serial.begin(115200);
        Serial.println("- - - - - setup - - - - -");
        Wire.begin();
        
        while (aht10.begin() != true) //for ESP-01 use aht10.begin(0, 2);
        {
          Serial.println(F("AHT1x not connected or fail to load calibration coefficient")); //(F()) save string to flash & keeps dynamic memory free
          delay(5000);
        }
      
        Serial.println(F("AHT10 OK"));
      }
      
      
      void loop()      
      {  
        Serial.println("getting humidity & temperature");
      
        ahtTemp = aht10.readTemperature(); //read 6-bytes via I2C, takes 80 milliseconds
        Serial.print(F("Temperature: "));
        Serial.print(ahtTemp);
        Serial.println(F(" +-0.3C"));
        
        delay(2000); //measurement with high frequency leads to heating of the sensor, see NOTE
      
        ahtHumi = aht10.readHumidity(); //read another 6-bytes via I2C, takes 80 milliseconds
        Serial.print(F("Humidity......: "));
        Serial.print(ahtHumi);
        Serial.println(F(" +-2%"));
      
        delay(10000);
      }
      

      but when i try to incorporate it in a mysensor sketch, it stays stuck at aht10.begin()

      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached 
      #define MY_RADIO_RF24
      
      #define MY_RF24_PA_LEVEL RF24_PA_HIGH
      
      #define MY_SECURITY_SIMPLE_PASSWD "xxxxxxxxxxxxxxxxxxxxxxx"
      
      #define MY_RF24_CHANNEL 14
      
      #include <SPI.h>
      #include <MySensors.h>
      // https://github.com/enjoyneering/AHTxx/blob/main/examples/AHT10_Serial/AHT10_Serial.ino
      #include <Wire.h>
      #include <AHTxx.h>
      
      static const uint64_t UPDATE_INTERVAL = 60*1000;
      
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      
      bool metric = true;
      
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      
      // AHT10
      float ahtTemp;                               //to store T/RH result
      float ahtHumi;
      
      AHTxx aht10(AHTXX_ADDRESS_X38, AHT1x_SENSOR); //sensor address, sensor type
      
      
      void presentation()  
      { 
        // Send the sketch version information to the gateway
        sendSketchInfo("aht10", "0.3");
        
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID_TEMP, S_TEMP, "Temperature");
        present(CHILD_ID_HUM, S_HUM, "Humidity");
        
        metric = getControllerConfig().isMetric;
      }
      
      
      void setup()
      {
        Serial.println("- - - - - setup - - - - -");
        Wire.begin();
        
        while (aht10.begin() != true) //for ESP-01 use aht10.begin(0, 2);
        {
          Serial.println(F("AHT1x not connected or fail to load calibration coefficient")); //(F()) save string to flash & keeps dynamic memory free
      
          delay(5000);
        }
      
        Serial.println(F("AHT10 OK"));
      }
      
      
      void loop()      
      {  
        #ifdef MY_DEBUG
          Serial.println("getting humidity & temperature");
        #endif
      
        ahtTemp = aht10.readTemperature(); //read 6-bytes via I2C, takes 80 milliseconds
        #ifdef MY_DEBUG
          Serial.print(F("Temperature: "));
          Serial.print(ahtTemp);
          Serial.println(F(" +-0.3C"));
        #endif
        
        delay(2000); //measurement with high frequency leads to heating of the sensor, see NOTE
      
        ahtHumi = aht10.readHumidity(); //read another 6-bytes via I2C, takes 80 milliseconds
        #ifdef MY_DEBUG
          Serial.print(F("Humidity......: "));
          Serial.print(ahtHumi);
          Serial.println(F(" +-2%"));
        #endif
      
      
        static MyMessage msgHum(CHILD_ID_HUM,  V_HUM);
        static MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      
        send(msgTemp.set(ahtTemp, 1));
        send(msgHum.set(ahtHumi, 1));
      
        // Sleep for a while to save energy
        sleep(UPDATE_INTERVAL);
      }
      

      has you see concerning the ath10 code it is exactly the same
      both are running with the same arduino nanos
      i triple checked my wirering
      and a same breakout board is working alone but not with mysensors code included

      any idea ?
      thanks

      posted in Development
      bach
      bach
    • RE: nano & E01-ML01SP4 gateway

      Hello guys,

      thank you for your intels ! i recieved the pcb and built it, it works
      i changed C1 for a 0.1µF, and removed R12
      i kept the resistor bridge for isp comm.
      i tried to activate buffer with irq but it's going rogue, gave up with that
      i doubt that the inclusion button has any utility, it seems to be just an other reset button

      It gives me a little serial gateway wich size is about the same as a "sonoff zigbee dongle plus"
      i'll have to make an enclosure for it now

      IMG_20230401_223435.jpg

      posted in My Project
      bach
      bach
    • RE: nano & E01-ML01SP4 gateway

      hello @monte
      thanks for your feedbacks

      monte about 4 hours ago
      You don't need resistors to drop voltage on data pins for NRF24, they are 5V tolerant

      for generic nrf24+ module yes i know
      but that's not what the e01-ml01sp4 datasheet is saying, so i prefer to be prudent, it can't do any arm ("ça mange pas de pain" in french)
      b58e8223-d753-4090-8627-efcd8eb517c3-image.png

      Also you don't need SO much capacitance 🙂 4,7uF is enough for stable work, as per my experience. Better add second cap 0.1uF in parallel to the big ones.

      do you mean 4.7uF for C1 instead of 47uF?
      and where would you put the 0.1uF ? on the output of ams1117 or in the input of nrf24 ?

      Also, why is AMS1117 connected to ground via resistor?

      i can't explain it as i don't fully understand it, i followed this tutorial https://maker.pro/arduino/projects/how-to-use-ams1117

      IRQ pin does nothing in current (and probably the last) version of MySensors, so you can skip routing it if it will help you in any way.

      ok, good to know, my pcb is already ordered but i'll remember that for my coming nodes.

      in current (and probably the last) version of MySensors

      may i ask why, what do you mean ?
      i'm new here, and as a free software enthusiaste developper discovering home automation since 2 years now (expensive closed zwave, closed zigbee then closed ptvo), i was super glad to finally find a project like mysensors, and on my way to explore it, i progressively understand that it's not as active as it was 😞

      posted in My Project
      bach
      bach
    • RE: serial nrf24 gateway is rebooting over and over

      hi electrick,
      thank you for the hint, i'm so glad that someone finally talks to me 🙂
      Yes i reached the same conclusion about power supply of the nrf24 board.
      3.3V pin from nano can only deliver 50mA when e01-ml01sp4 needs 120mA.
      I redesigned my project including a ams1117 between nano's 5V pin and the radio board
      https://forum.mysensors.org/topic/12109/nano-e01-ml01sp4-gateway/4?_=1679247873047
      next episode when i'll receive the new pcb !

      posted in Troubleshooting
      bach
      bach
    • RE: nano & E01-ML01SP4 gateway

      i refactored entirely again my gateway as 3.3V pin from nano is not powerful enough (50mA) for the e01-ml01sp4 (120mA)
      nano is rebooting when attempting connexion or serial reading

      here is the new schematic and pcb
      Screenshot_20230319_184230.png
      Screenshot_20230319_201930.png
      Screenshot_20230319_201839.png

      posted in My Project
      bach
      bach
    • RE: nano & E01-ML01SP4 gateway

      and some pictures

      IMG_20230317_230541.jpg IMG_20230317_230753.jpg

      posted in My Project
      bach
      bach
    • serial nrf24 gateway is rebooting over and over

      Hi,

      i built a serial gateway with a nano and E01-ML01SP4 nrf24 ebyte module
      https://www.ebyte.com/en/product-view-news.aspx?id=114

      i posted about it here https://forum.mysensors.org/topic/12109/nano-e01-ml01sp4-gateway

      the problème is the gate way is rebooting alone each time i try to read the serial

      of course my controler (HA) can't get the data as the gateway is always rebooting

      my node (wich is working with an other nrf24 gateway) can't connect neither

      my gateway sketch is default one with

      // Enable debug prints to serial monitor
      #define MY_DEBUG
      #define MY_DEBUG_VERBOSE_GATEWAY
      #define MY_DEBUG_VERBOSE_RF24
      
      // Enable and select radio type attached
      #define MY_RADIO_RF24
      //#define MY_RADIO_NRF5_ESB
      //#define MY_RADIO_RFM69
      //#define MY_RADIO_RFM95
      
      // Set LOW transmit power level as default, if you have an amplified NRF-module and
      // power your radio separately with a good regulator you can turn up PA level.
      #define MY_RF24_PA_LEVEL RF24_PA_LOW
      
      //#define MY_RF24_CE_PIN (12)
      //#define MY_RF24_CS_PIN (13)
      //#define MY_RF24_IRQ_PIN (5)
      
      
      // Enable serial gateway
      #define MY_GATEWAY_SERIAL
      
      // Define a lower baud rate for Arduinos running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
      #if F_CPU == 8000000L
      #define MY_BAUD_RATE 38400
      #endif
      
      // Enable inclusion mode
      #define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      #define MY_INCLUSION_BUTTON_FEATURE
      
      // Inverses behavior of inclusion button (if using external pullup)
      //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
      
      // Set inclusion mode duration (in seconds)
      #define MY_INCLUSION_MODE_DURATION 180
      // Digital pin used for inclusion mode button
      #define MY_INCLUSION_MODE_BUTTON_PIN  3
      
      // Set blinking period
      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Inverses the behavior of leds
      //#define MY_WITH_LEDS_BLINKING_INVERSE
      
      // Flash leds on rx/tx/err
      // Uncomment to override default HW configurations
      #define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
      #define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
      #define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED
      
      #define MY_RF24_CHANNEL 14
      
      // signing
      #define MY_SIGNING_SIMPLE_PASSWD "MYAWSOMEPASSWD"
      
      #include <MySensors.h>
      
      void setup()
      {
      	// Setup locally attached sensors
      }
      
      void presentation()
      {
      	// Present locally attached sensors
      }
      
      void loop()
      {
      	// Send locally attached sensor data here
      }
      
      

      i can't figure what is going out
      some help would be really appreciated

      ---- Opened the serial port /dev/ttyUSB2 ----
      0;255;3;0;9;0 MCO:BGN:INIT GW,CP=RNNGAS--,FQ=16,REL=255,VER=2.3.2
      0;255;3;0;9;39 TSM:INIT
      0;255;3;0;9;41 TSF:WUR:MS=0
      0;255;3;0;9;45 RF24:INIT:PIN,CE=9,CS=10
      0;255;3;0;9;48 RF24:SBY
      0;255;3;0;9;50 RF24:WBR:REG=0,VAL=14
      0;255;3;0;9;58 RF24:WBR:REG=3,VAL=3
      0;255;3;0;9;61 RF24:WBR:REG=4,VAL=95
      0;255;3;0;9;64 RF24:WBR:REG=5,VAL=14
      0;255;3;0;9;68 RF24:WBR:REG=6,VAL=39
      0;255;3;0;9;71 RF24:WBR:REG=29,VAL=4
      0;255;3;0;9;74 RF24:RBR:REG=29,VAL=4
      0;255;3;0;9;77 RF24:RBR:REG=6,VAL=39
      0;255;3;0;9;81 RF24:RBR:REG=5,VAL=14
      0;255;3;0;9;84 RF24:WBR:REG=2,VAL=2
      0;255;3;0;9;88 RF24:WBR:REG=1,VAL=0
      0;255;3;0;9;91 RF24:WBR:REG=28,VAL=3
      0;255;3;0;9;95 RF24:FRX
      0;255;3;0;9;97 RF24:FTX
      0;255;3;0;9;99 RF24:WBR:REG=7,VAL=112
      0;255;3;0;9;102 TSM:INIT:TSP OK
      0;255;3;0;9;105 TSM:INIT:GW MODE
      0;255;3;0;9;108 RF24:WBR:REG=2,VAL=3
      0;255;3;0;9;111 RF24:WBR:REG=1,VAL=1
      0;255;3;0;9;114 RF24:STL
      0;255;3;0;9;117 RF24:WBR:REG=0,VAL=15
      0;255;3;0;9;120 RF24:WBR:REG=10,VAL=0
      0;255;3;0;9;123 TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;128 MCO:REG:NOT NEEDED
      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.3.2
      0;255;3;0;9;132 MCO:BGN:STP
      0;255;3;0;9;139 RF24:RBR:REG=6,VAL=39
      0;255;3;0;9;142 RF24:RBR:REG=5,VAL=14
      0;255;3;0;9;145 MCO:BGN:INIT OK,TSP=1
      0;255;3;0;9;149 TSM:READY:NWD REQ
      0;255;3;0;9;152 RF24:SPL
      0;255;3;0;9;154 RF24:WBR:REG=0,VAL=14
      0;255;3;0;9;157 RF24:OWP:RCPT=255
      0;255;3;0;9;160 RF24:WBR:REG=10,VAL=255
      0;255;3;0;9;164 RF24:WBR:REG=16,VAL=255
      0;255;3;0;9;167 RF24:TXM:TO=255,LEN=7
      0;255;3;0;9;172 RF24:FTX
      0;255;3;0;9;174 RF24:WBR:REG=4
      ---- Closed serial port /dev/ttyUSB2 due to disconnection from the machine ----
      ---- Reopened serial port /dev/ttyUSB2 ----
      0;255;3;0;9;0 MCO:BGN:INIT GW,CP=RNNGAS--,FQ=16,REL=255,VER=2.3.2
      0;255;3;0;9;40 TSM:INIT
      0;255;3;0;9;43 TSF:WUR:MS=0
      0;255;3;0;9;45 RF24:INIT:PIN,CE=9,CS=10
      0;255;3;0;9;49 RF24:SBY
      0;255;3;0;9;51 RF24:WBR:REG=0,VAL=14
      0;255;3;0;9;59 RF24:WBR:REG=3,VAL=3
      0;255;3;0;9;62 RF24:WBR:REG=4,VAL=95
      0;255;3;0;9;65 RF24:WBR:REG=5,VAL=14
      0;255;3;0;9;68 RF24:WBR:REG=6,VAL=39
      0;255;3;0;9;71 RF24:WBR:REG=29,VAL=4
      0;255;3;0;9;75 RF24:RBR:REG=29,VAL=4
      0;255;3;0;9;78 RF24:RBR:REG=6,VAL=39
      0;255;3;0;9;81 RF24:RBR:REG=5,VAL=14
      0;255;3;0;9;84 RF24:WBR:REG=2,VAL=2
      0;255;3;0;9;89 RF24:WBR:REG=1,VAL=0
      0;255;3;0;9;92 RF24:WBR:REG=28,VAL=3
      0;255;3;0;9;95 RF24:FRX
      0;255;3;0;9;97 RF24:FTX
      0;255;3;0;9;100 RF24:WBR:REG=7,VAL=112
      0;255;3;0;9;103 TSM:INIT:TSP OK
      0;255;3;0;9;106 TSM:INIT:GW MODE
      0;255;3;0;9;109 RF24:WBR:REG=2,VAL=3
      0;255;3;0;9;112 RF24:WBR:REG=1,VAL=1
      0;255;3;0;9;115 RF24:STL
      0;255;3;0;9;117 RF24:WBR:REG=0,VAL=15
      0;255;3;0;9;121 RF24:WBR:REG=10,VAL=0
      0;255;3;0;9;124 TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;129 MCO:REG:NOT NEEDED
      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.3.2
      0;255;3;0;9;133 MCO:BGN:STP
      0;255;3;0;9;139 RF24:RBR:REG=6,VAL=39
      0;255;3;0;9;143 RF24:RBR:REG=5,VAL=14
      0;255;3;0;9;146 MCO:BGN:INIT OK,TSP=1
      0;255;3;0;9;149 TSM:READY:NWD REQ
      0;255;3;0;9;152 RF24:SPL
      0;255;3;0;9;155 RF24:WBR:REG=0,VAL=14
      0;255;3;0;9;158 RF24:OWP:RCPT=255
      0;255;3;0;9;161 RF24:WBR:REG=10,VAL=255
      0;255;3;0;9;165 RF24:WBR:REG=16,VAL=255
      0;255;3;0;9;168 RF24:TXM:TO=255,LEN=7
      0;255;3;0;9;172 RF24:FTX
      0;255;3;0;9;175 RF24:WBR:REG=
      ---- Closed serial port /dev/ttyUSB2 due to disconnection from the machine ----
      ---- Reopened serial port /dev/ttyUSB2 ----
      0;255;3;0;9;0 MCO:BGN:INIT GW,CP=RNNGAS--,FQ=16,REL=255,VER=2.3.2
      0;255;3;0;9;39 TSM:INIT
      0;255;3;0;9;41 TSF:WUR:MS=0
      0;255;3;0;9;44 RF24:INIT:PIN,CE=9,CS=10
      0;255;3;0;9;48 RF24:SBY
      0;255;3;0;9;50 RF24:WBR:REG=0,VAL=14
      0;255;3;0;9;58 RF24:WBR:REG=3,VAL=3
      0;255;3;0;9;61 RF24:WBR:REG=4,VAL=95
      0;255;3;0;9;64 RF24:WBR:REG=5,VAL=14
      etc
      etc
      etc
      ...
      

      home assistant logs

      Logger: mysensors.transport
      Source: runner.py:179
      First occurred: 19:54:22 (99 occurrences)
      Last logged: 22:38:52
      
      device reports readiness to read but returned no data (device disconnected or multiple access on port?)
      
      
      Logger: mysensors.gateway_serial
      Source: runner.py:179
      First occurred: 19:54:22 (1033 occurrences)
      Last logged: 22:49:22
      
      Unable to connect to /dev/ttyUSB2
      
      posted in Troubleshooting
      bach
      bach