Navigation

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

    ctodor

    @ctodor

    4
    Reputation
    24
    Posts
    2
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online

    ctodor Follow

    Best posts made by ctodor

    • Gateway doesn't receive any message from node

      Hi
      My setup is:

      Hardware

      GW
      Arduino Nano 5v
      RFM69
      DC-DC from 5v to 3.3v and 100uF capacitor

      Node
      Arduino ProMini 3.3v
      RFM69

      Software

      GW

      #define MY_DEBUG

      #define MY_RADIO_RFM69
      #define MY_RFM69_FREQUENCY RFM69_868MHZ
      #define MY_GATEWAY_SERIAL

      *#define MY_INCLUSION_MODE_FEATURE
      #define MY_INCLUSION_MODE_DURATION 60
      #define MY_DEFAULT_LED_BLINK_PERIOD 300

      #include <MySensors.h>*
      void setup(){}
      void presentation(){}
      void loop(){}

      Distance between GW and Node is aprox. 1m

      Node

      #define MY_NODE_ID 100

      #define MY_DEBUG
      #define MY_DEBUG_VERBOSE_RFM69
      #define MY_DEBUG_VERBOSE_RFM69_REGISTERS
      #define MY_DEBUG_VERBOSE_TRANSPORT
      #define MY_DEBUG_VERBOSE_CORE

      // Enable and select radio type attached MY_RADIO_RFM69
      #define MY_RADIO_RFM69
      #define MY_RFM69_FREQUENCY RFM69_868MHZ

      #define MY_PARENT_NODE_IS_STATIC
      #define MY_PARENT_NODE_ID 0x0

      #include <MySensors.h>
      void presentation() {
      sendSketchInfo("TestNode", "1.0");
      present(0, S_ARDUINO_NODE, "Counter");
      }

      Logs

      GW

      0;255;3;0;9;0 MCO:BGN:INIT GW,CP=RRNGA---,FQ=16,REL=255,VER=2.3.2
      0;255;3;0;9;5 TSM:INIT
      0;255;3;0;9;7 TSF:WUR:MS=0
      0;255;3;0;9;12 TSM:INIT:TSP OK
      0;255;3;0;9;19 TSM:INIT:GW MODE
      0;255;3;0;9;22 TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;26 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;30 MCO:BGN:STP
      0;255;3;0;9;37 MCO:BGN:INIT OK,TSP=1
      0;255;3;0;9;44 TSM:READY:NWD REQ
      0;255;3;0;9;49 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:

      Node

      16 MCO:BGN:INIT NODE,CP=RRNNA---,FQ=8,REL=255,VER=2.3.2
      28 TSM:INIT
      28 TSF:WUR:MS=0
      34 TSM:INIT:TSP OK
      38 TSM:INIT:STATID=100
      43 TSF:SID:OK,ID=100
      45 TSM:FPAR
      47 TSM:FPAR:STATP=0
      49 TSM:ID
      49 TSM:ID:OK
      51 TSM:UPL
      1269 !TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
      3278 TSM:UPL
      4497 !TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=1,st=NACK:1
      6506 TSM:UPL
      7725 !TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=2,st=NACK:1
      9734 TSM:UPL
      10952 !TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=3,st=NACK:1
      12961 !TSM:UPL:FAIL
      12963 TSM:FPAR
      12963 TSM:FPAR:STATP=0
      12967 TSM:ID
      12967 TSM:ID:OK
      12969 TSM:UPL
      14190 !TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=4,st=NACK:1
      16199 TSM:UPL
      17418 !TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=5,st=NACK:1
      19427 TSM:UPL
      20645 !TSF:MSG:SEND,100-100-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=6,st=NACK:1
      22657 TSM:UPL

      Any info/suggestion is highly appreciated.
      Thank you

      posted in Troubleshooting
      ctodor
      ctodor
    • RE: Gateway doesn't receive any message from node

      Here are the pictures:
      pcb2.jpeg pcb1.jpeg

      But my question (maybe stupid question) is: It is possible the the radio module to be broken only on the "send side"?

      Thank you.

      posted in Troubleshooting
      ctodor
      ctodor
    • RE: Gateway doesn't receive any message from node

      @mfalkvidd multimeter

      posted in Troubleshooting
      ctodor
      ctodor
    • RE: Gateway doesn't receive any message from node

      Update: it seems the problem was the DC-DC convertor. I have replace it with an extwrnal power source and now it works.
      I still don't understand what was wrong there because the voltage on the radio module was correct:3.3V

      posted in Troubleshooting
      ctodor
      ctodor

    Latest posts made by ctodor

    • RE: Can not compile on Arduino Nano ESP 32

      @eiten You are right. It is not the same sketch. The previuos sketch seems to work fine (I used it just to make sure I am able to compile and upload).
      Now I'm trying to upload a sketch where the ardunio runs as gateway and this is what a need , a gateway that receives messages from a few magnetic door sensors.
      But please, don't waste your time with me. I think I'm going to write my simple protocol to do such a simple task.

      Thank you very much for your effort.

      posted in Troubleshooting
      ctodor
      ctodor
    • RE: Can not compile on Arduino Nano ESP 32

      @eiten Yep, I was able to upload the sketch after I've set Tools -> USB-Mode -> CDC-Mode.
      Thank you for your help.

      Well, I think I rushed with the conclusion.
      Somehow, the bord is now in infinite boot loop:

      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.3.2
      ESP-ROM:esp32s3-20210327
      Build:Mar 27 2021
      rst:0x8 (TG1WDT_SYS_RST),boot:0x2b (SPI_FAST_FLASH_BOOT)
      Saved PC:0x4200d223
      SPIWP:0xee
      mode:DIO, clock div:1
      load:0x3fce3808,len:0x44c
      load:0x403c9700,len:0xbe4
      load:0x403cc700,len:0x2a68
      entry 0x403c98d4

      repetes over and over

      posted in Troubleshooting
      ctodor
      ctodor
    • RE: Can not compile on Arduino Nano ESP 32

      @eiten
      Sorry for the late response, but I didn't had time to work on it until today.

      Yes, I was able to compile but not to upload. After "uploading", the Arduino NANO ESP 32 disconects from the PC.
      I must reset the board in order to be able to upload another sketch.

      posted in Troubleshooting
      ctodor
      ctodor
    • RE: Can not compile on Arduino Nano ESP 32

      @eiten 👍

      posted in Troubleshooting
      ctodor
      ctodor
    • RE: Can not compile on Arduino Nano ESP 32

      @eiten Thx for the info.
      "Try the developement branch from the github": can you give me the url?

      posted in Troubleshooting
      ctodor
      ctodor
    • RE: Can not compile on Arduino Nano ESP 32

      @eiten
      It is the SoilMoistSensor.ino skecth from MySensor example.

      *// Enable debug prints to serial monitor
      #define MY_DEBUG
      //#define MY_GATEWAY_ESP32

      // Enable and select radio type attached
      //#define MY_RADIO_RF24
      //#define MY_RADIO_NRF5_ESB
      #define MY_RADIO_RFM69
      //#define MY_RADIO_RFM95

      #include <math.h> // Conversion equation from resistance to %
      #include <MySensors.h>

      // Setting up format for reading 3 soil sensors
      #define NUM_READS (int)10 // Number of sensor reads for filtering
      #define CHILD_ID 0

      MyMessage msg(CHILD_ID, V_LEVEL);
      uint32_t SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)

      long buffer[NUM_READS];
      int idx;

      /// @brief Structure to be used in percentage and resistance values matrix to be filtered (have to be in pairs)
      typedef struct {
      int moisture; //!< Moisture
      long resistance; //!< Resistance
      } values;

      const long knownResistor = 4700; // Constant value of known resistor in Ohms

      int supplyVoltage; // Measured supply voltage
      int sensorVoltage; // Measured sensor voltage

      values valueOf[NUM_READS]; // Calculated moisture percentages and resistances to be sorted and filtered

      int i; // Simple index variable

      void setup()
      {
      // initialize the digital pins as an output.
      // Pin 6,7 is for sensor 1
      // initialize the digital pin as an output.
      // Pin 6 is sense resistor voltage supply 1
      pinMode(6, OUTPUT);

      // initialize the digital pin as an output.
      // Pin 7 is sense resistor voltage supply 2
      pinMode(7, OUTPUT);
      

      }

      void presentation()
      {
      sendSketchInfo("Soil Moisture Sensor Reverse Polarity", "1.0");
      present(CHILD_ID, S_MOISTURE);
      }

      void loop()
      {

      measure(6,7,1);
      Serial.print ("\t");
      Serial.println (average());
      long read1 = average();
      
      measure(7,6,0);
      Serial.print ("\t");
      Serial.println (average());
      long read2= average();
      
      long sensor1 = (read1 + read2)/2;
      
      Serial.print ("resistance bias =" );
      Serial.println (read1-read2);
      Serial.print ("sensor bias compensated value = ");
      Serial.println (sensor1);
      Serial.println ();
      
      //send back the values
      send(msg.set((int32_t)ceil(sensor1)));
      // delay until next measurement (msec)
      sleep(SLEEP_TIME);
      

      }

      void measure (int phase_b, int phase_a, int analog_input)
      {
      // read sensor, filter, and calculate resistance value
      // Noise filter: median filter

      for (i=0; i<NUM_READS; i++) {
      
      	// Read 1 pair of voltage values
      	digitalWrite(phase_a, HIGH);                 // set the voltage supply on
      	delayMicroseconds(25);
      	supplyVoltage = analogRead(analog_input);   // read the supply voltage
      	delayMicroseconds(25);
      	digitalWrite(phase_a, LOW);                  // set the voltage supply off
      	delay(1);
      
      	digitalWrite(phase_b, HIGH);                 // set the voltage supply on
      	delayMicroseconds(25);
      	sensorVoltage = analogRead(analog_input);   // read the sensor voltage
      	delayMicroseconds(25);
      	digitalWrite(phase_b, LOW);                  // set the voltage supply off
      
      	// Calculate resistance
      	// the 0.5 add-term is used to round to the nearest integer
      	// Tip: no need to transform 0-1023 voltage value to 0-5 range, due to following fraction
      	long resistance = (knownResistor * (supplyVoltage - sensorVoltage ) / sensorVoltage) ;
      
      	delay(1);
      	addReading(resistance);
      	Serial.print (resistance);
      	Serial.print ("\t");
      }
      

      }

      // Averaging algorithm
      void addReading(long resistance)
      {
      buffer[idx] = resistance;
      idx++;
      if (idx >= NUM_READS) {
      idx = 0;
      }
      }

      long average()
      {
      long sum = 0;
      for (int cnt = 0; cnt < NUM_READS; cnt++) {
      sum += buffer[cnt];
      }
      return (long)(sum / NUM_READS);
      }*

      posted in Troubleshooting
      ctodor
      ctodor
    • Can not compile on Arduino Nano ESP 32

      Hi,
      I'm trying to compile one of the example on Arduino Nano ESP32. (MySensors version 2.3.2)
      Am I doing something wrong?

      ***Compiling debug version of 'SoilMoistSensor' for 'Arduino Nano ESP32 (nano_nora)'

      esp32-hal-uart.c: In function uartSetPins

      esp32-hal-uart.c: 153:9: warning: 'return' with no value, in function returning non-void
      return
      ^~~~~~
      esp32-hal-uart.c:149: note declared here
      bool uartSetPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin)
      ^~~~~~~~~~~

      mysensors.h:61: In file included from
      SoilMoistSensor.ino:73: from

      MyHwESP32.cpp: In function bool hwInit()

      MyHwESP32.cpp: 30:48: error: no matching function for call to 'USBCDC::begin(long unsigned int, SerialConfig)
      MY_SERIALDEVICE.begin(MY_BAUD_RATE, SERIAL_8N1)

      USB.h:21: In file included from
      HardwareSerial.h:201: from
      arduino.h:184: from
      SoilMoistSensor.ino: from
      USBCDC.h:70: note candidate void USBCDC begin(long unsigned int)
      void begin(unsigned long baud=0)
      ^~~~~
      USBCDC.h:70: note candidate expects 1 argument, 2 provided

      SoilMoistSensor.ino: In function void loop()

      SoilMoistSensor.ino: 143:17: error: call of overloaded 'sleep(uint32_t&)' is ambiguous
      sleep(SLEEP_TIME)

      unistd.h:23: In file included from
      unistd.h:4: from
      pthread.h:25: from
      pthread.h:21: from
      gthr-default.h:48: from
      gthr.h:151: from
      atomicity.h:35: from
      basic_string.h:39: from
      string:52: from
      stdexcept:39: from
      array:39: from
      tuple:39: from
      functional:54: from
      Error compiling project sources
      HardwareSerial.h:49: from
      arduino.h:184: from
      Debug build failed for project 'SoilMoistSensor'
      SoilMoistSensor.ino: from***

      posted in Troubleshooting
      ctodor
      ctodor
    • RE: Gateway doesn't receive any message from node

      @mfalkvidd multimeter

      posted in Troubleshooting
      ctodor
      ctodor
    • RE: Gateway doesn't receive any message from node

      Update: it seems the problem was the DC-DC convertor. I have replace it with an extwrnal power source and now it works.
      I still don't understand what was wrong there because the voltage on the radio module was correct:3.3V

      posted in Troubleshooting
      ctodor
      ctodor
    • RE: Gateway doesn't receive any message from node

      @yury may be node radio is HCW somehow? no, it is not.

      I'll try to create a new board and give feedback.

      posted in Troubleshooting
      ctodor
      ctodor