Navigation

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

    Topics created by DanieleF

    • DanieleF

      Ethernet gateway and receive function
      Troubleshooting • • DanieleF  

      7
      0
      Votes
      7
      Posts
      496
      Views

      DanieleF

      This is the full code, in my previous message I tried simplifing it and I missed a variable declaration: #define MY_DEBUG //#define MY_DEBUG_DETAIL #define MY_GATEWAY_W5100 #define MY_RF24_CS_PIN 3 #define MY_RF24_IRQ_PIN 2 #define MY_RX_MESSAGE_BUFFER_FEATURE 6 #define MY_IP_ADDRESS 192,168,1,20 #define MY_IP_GATEWAY_ADDRESS 192,168,1,1 #define MY_IP_SUBNET_ADDRESS 255,255,255,0 #define MY_PORT 5003 #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED #if defined(MY_USE_UDP) #include <EthernetUdp.h> #endif #include <Ethernet.h> #define CHILD_ID_LIGHT 1 #include <MyRF24_P2_GW.h> #include <MySensors.h> MyMessage msgLIGHT(CHILD_ID_LIGHT, V_STATUS); #define BUTTON_UP A4 #define BUTTON_DW A5 #include <Bounce2.h> Bounce debounceUp = Bounce(); Bounce debounceDw = Bounce(); bool statoLuci = 1; const byte numReed = 4; const byte pinReed[numReed] = {A0,A1,A2,A3}; const byte pinRelay[numReed] = {5,6,7,8}; bool statoReed[numReed]; void setup() { // request(CHILD_ID_LIGHT, V_STATUS); debounceUp.attach(BUTTON_UP, INPUT_PULLUP); debounceUp.interval(5); debounceDw.attach(BUTTON_DW, INPUT_PULLUP); debounceDw.interval(5); for (int i=0; i<numReed; i++){ pinMode(pinReed[i], INPUT_PULLUP); statoReed[i] = 0; pinMode(pinRelay[i], OUTPUT); } } void presentation() { present(CHILD_ID_LIGHT, S_BINARY, "P2 Luci Armadio"); } void loop() { debounceUp.update(); debounceDw.update(); if ( debounceUp.fell() ) { Serial.println("UP"); } if ( debounceDw.fell() ) { Serial.println("DOWN"); } for (int i=0; i<numReed; i++){ if (statoLuci){ statoReed[i] = digitalRead(pinReed[i]); digitalWrite(pinRelay[i], statoReed[i]); } else digitalWrite(pinRelay[i], 0); #ifdef MY_DEBUG_DETAIL Serial.print("Reed "); Serial.print(i); Serial.print(" : "); Serial.println(statoReed[i]); #endif } #ifdef MY_DEBUG_DETAIL Serial.println("****************"); wait(1000); #endif } /* void receive(const MyMessage &message) { if (message.destination == 0 && message.type == V_STATUS && message.sensor == CHILD_ID_LIGHT && !message.isAck()) { #ifdef MY_DEBUG Serial.println("*** Receiving ***"); #endif statoLuci = message.getBool(); } } */ MyRF24_2_GW.h contains simply some common defines I use for all the nodes connected to this GW: #define MY_RADIO_NRF24 #define MY_RF24_DATARATE RF24_250KBPS #define MY_RF24_CHANNEL 115 #ifndef MY_RF24_PA_LEVEL #define MY_RF24_PA_LEVEL RF24_PA_HIGH #endif #ifndef MY_PARENT_NODE_ID #define MY_PARENT_NODE_ID 0 #define MY_PARENT_NODE_IS_STATIC #endif
    • DanieleF

      NRF24 transport status not initialized
      Troubleshooting • • DanieleF  

      12
      0
      Votes
      12
      Posts
      688
      Views

      Yveaux

      @mfalkvidd said in NRF24 transport status not initialized: I do not know what they were intended for Tekka's chart says it all; preHwInit() has no serial output, so can be used to e.g. initialize serial devices (some hardware might require this). Then before() is called which starts logging to serial.
    • DanieleF

      Log parser error
      Troubleshooting • • DanieleF  

      3
      0
      Votes
      3
      Posts
      457
      Views

      DanieleF

      It works perfectly now! Thanks Daniele
    • DanieleF

      Recompiling for different channels
      Development • mysbootloader • • DanieleF  

      13
      0
      Votes
      13
      Posts
      1102
      Views

      rejoe2

      Seems I'm running out of ideas. If you are sure to have flashed succcessfully the new BL and won't get any sync afterwards to upload any sketch built using that board def, most likely you shoud open an issue in github wrt that. (I myself went the other way round and modified the MYSENSORS modules in FHEM to make use of a second Gateway for flash purposes only - this GW with the standard channel (etc.) settings... Testing is ongoing, but seems to work)
    • DanieleF

      ENC28J60 Gateway - no ping
      Hardware • • DanieleF  

      7
      0
      Votes
      7
      Posts
      1540
      Views

      hard-shovel

      @daniele-frigo I have tried the stable and development versions of my sensors, the standard UIPEthernet.h and the Mysensors version of UIPEthernet.h, and several versions of Arduino IDE and still cannot replicate your log result of getting only one line of debug data using your program. This should generate five lines of debug code regardless if the ENC module is connected. With the module connected you should be able to ping the arduino on 192.168.1.22 if your computer is on the same subnet. So several questions & things to consider 1 Are you actually testing using the code you posted above and getting only the one line of debug If so, then I think you need to check your software versions, 1a Are you using Arduino IDE or some other environment like PlatformIO what versions? 1b Is the correct UIPEthernet.h being used during compiling? 1c Are there any error messages during compiling, what is the memory usage? 1d what bootloader are you using? the Old nano Bootloader, New nano type or some other? 2 Is the network address suitable for your network and you have no other item using that ip address and no arduino device using the same MAC address for pinging Is your computer on the same subnet ie 192.168.1.xxx 3 My ENC modules are power hungry they take about 150mA with only a nano attached. Is you power supply sufficient and smooth? 4 Are you plugging the board to the nano or using jumpers? If using jumpers try and jumper from the Nano pin 10(CS) to pin 8 on the board it is possible the board has the cs connection on pin 8. 5 You could try loading the UIPEthernet example EchoServer and see if you can then get echo back from your computer if you use telnet on your computer. When doing this use a suitable MAC, IP address and port number on the arduino for your computer network. This example uses the same connections as the gateway so no wiring changes. You should then be able to connect and then get text sent from the computer echoed back from the arduino using telnet. 6 Failed Parts! Original Nano If you were powering the original nano from the USB port then i suspect the input diode has partially failed, so will supply very limited power to the board from the USB connector, If you were powering the nano via the RAW pin then the voltage regulator is suspect. ENC28J60 Board If the Link and Data LEDs are lighting up then the ENC28J60 is working to some extent as these LEDs are controlled by the chip. So I suspect the programing and then power / connections. Of course even if you get this working this chip is second rate compared to the W5100 or W5500 in both memory consumption and speed.
    • DanieleF

      Node randomly disconnecting
      Troubleshooting • • DanieleF  

      2
      0
      Votes
      2
      Posts
      570
      Views

      mfalkvidd

      Hi @daniele-frigo, welcome to the MySensors community! The best way to debug is to get the debug log from the node. Either by connecting a computer and keeping it on until the node acts up, or by using a standalone logger like this https://www.openhardware.io/view/532/The-Logger-Machine-Short-and-long-term-serial-logging