• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login

    1.1.0-snapshot, still having problems...

    Scheduled Pinned Locked Moved Troubleshooting
    28 Posts 3 Posters 6.0k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • skywatchS Offline
      skywatch
      last edited by skywatch

      After building arduino gw and moving to pi3 I still get crashes where no data is s received by MYC.
      After todays crash I stopped myc and tailed the gw - here is what I get...

      pi@HAMASS:/home/mycontroller/logs $ sudo tail -f /dev/serial0
      0;255;3;0;9;6300076 TSF:SAN:OK
      0;255;3;0;5;0
      0;255;3;0;5;1
      0;255;3;0;5;0
      0;255;3;0;5;1
      0;255;3;0;5;0
      0;255;3;0;5;1
      0;255;3;0;5;0
      0;255;3;0;5;1
      0;255;3;0;5;0
      0;255;3;0;5;1
      0;255;3;0;5;0
      0;255;3;0;5;1
      0;255;3;0;5;0
      0;255;3;0;5;1
      

      That doesn't look right to me. - Also the MYC log gives a lot of this.....

      [org.mycontroller.standalone.message.McMessageEngine:292] Inclusion mode not supported by this controller! Message:McMessage(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=C_INTERNAL, subType=Inclusion mode, ack=0, payload=1, isTxMessage=false, networkType=MY_SENSORS, isScreeningDone=true, timestamp=1510085501344, properties={})
      

      and

      2017-11-07 16:12:09,401 ERROR [Thread-6] [org.mycontroller.standalone.provider.mysensors.MySensorsProviderBridge:64] Unable to process this rawMessage:RawMessage(gatew$
      org.mycontroller.standalone.message.RawMessageException: Unknown message format:[5ᆬ^A^B]
              at org.mycontroller.standalone.provider.mysensors.MySensorsRawMessage.updateSerialMessage(MySensorsRawMessage.java:183)
              at org.mycontroller.standalone.provider.mysensors.MySensorsRawMessage.<init>(MySensorsRawMessage.java:68)
              at org.mycontroller.standalone.provider.mysensors.MySensorsProviderBridge.executeRawMessage(MySensorsProviderBridge.java:58)
              at org.mycontroller.standalone.message.McMessageUtils.sendToProviderBridge(McMessageUtils.java:579)
              at org.mycontroller.standalone.message.MessageMonitorThread.processRawMessage(MessageMonitorThread.java:107)
              at org.mycontroller.standalone.message.MessageMonitorThread.run(MessageMonitorThread.java:182)
              at java.lang.Thread.run(Thread.java:748)
      

      I am guessing this is because I set the gw to use an inclusion button to stop 'rogue' nodes compromising the network?

      Pi is up-to-date with update/upgrade and firmware...

      Any ideas?

      T 1 Reply Last reply Reply Quote 0
      • T Offline
        Tag MOD @skywatch
        last edited by

        @skywatch

        How did you setup/wire the button? and how do things work is the button is removed?

        seems that 5 is the inclusion mode, and 0 and 1 starting/stopping
        See here

        1 Reply Last reply Reply Quote 0
        • skywatchS Offline
          skywatch
          last edited by skywatch

          @Tag

          I searched on this forum for 'inclusion mode' and it says it is not supported (so the message in the above log also says the same thing). So I reflashed the gateway to remove this function.

          Once the gw and sd card were reflashed it was working agian. I also replaced the nrf with a pa/lna version to see if that would help at all.

          After doing this with it all working I stopped MYC and tailed the gw. This time I could see the sensor data (which was missing in the previous attempt with all '5''s in it - It should be there no?).

          As for wiring, the button pin was probably floating after I triggered it. Maybe something to look into, but for now I have a relay to try and get working.

          Thanks as always! 🙂

          T 1 Reply Last reply Reply Quote 0
          • T Offline
            Tag MOD @skywatch
            last edited by

            @skywatch 👍
            (Floating pins can get you strange readings) Good you see the sensor data now!! 🙂

            1 Reply Last reply Reply Quote 0
            • skywatchS Offline
              skywatch
              last edited by

              Happened again yesterday - won't post log as it's pretty much the same.

              This time I was able to recover by powering off the pi and gw arduino, waiting 30seconds and then powering up again. So far it's all running fine again!

              I may add some capacitors to help stabilise the power for the pi and arduino and see if that helps. I do have one node that 'sometimes' needs to be rebooted when it stops working. Again it may be power related. We'll see on that... 😉

              T 1 Reply Last reply Reply Quote 0
              • T Offline
                Tag MOD @skywatch
                last edited by Tag

                @skywatch

                did you update the arduino with the gateway sketch without the inclusion button stuff?

                should be commented out in either your sketch or in mysensors.h

                // Enabled inclusion mode feature
                #define MY_INCLUSION_MODE_FEATURE
                
                // Enables inclusion-mode button feature on the gateway device
                #define MY_INCLUSION_BUTTON_FEATURE
                
                // Set which pin you have the inclusion button attached to
                #define MY_INCLUSION_MODE_BUTTON_PIN 3
                
                // Set inclusion mode duration (in seconds)
                #define MY_INCLUSION_MODE_DURATION 60
                

                How do you power your rpi?

                1 Reply Last reply Reply Quote 0
                • skywatchS Offline
                  skywatch
                  last edited by skywatch

                  Hi @Tag

                  Yes I did remove the inculed button as I could not get it to work and stability is what I really need right now.

                  Rpi3 powered from a 5v 3A switchmode psu. Should be plenty for what it is doing...

                  The GW is currently using 2.2.0-beta and tomorrow I will update to 2.2.0-rc1 and see if that helps at all. I am reflashing nodes using 2.2.0-rc1 tomorrow as well, but have a couple of new ones that are driving me mad (still a lot to learn it seems) 😉

                  T 1 Reply Last reply Reply Quote 0
                  • T Offline
                    Tag MOD @skywatch
                    last edited by

                    @skywatch

                    Did you only remove the hardware, or also the inclusion button stuff from your sketch?
                    It might be that just removing the hardware is not enough....

                    Your power supply with 3 amps should be enough have you ever tested another, sometimes the 5v coming from cheap wall plugs is not that clean... (not saying yours is cheap!!)

                    for what it is worth, i use a mix from 1.5x to 2.2x it works great up until now... but you can always try...

                    The nrf's you are using, are these with the "real" chip on it, or do you use the ones with a black round "blob" on them? I am asing, since i received these once and they gave me all kinds of issues....

                    Keep going!, and keep us posted!!
                    good luck!

                    1 Reply Last reply Reply Quote 0
                    • skywatchS Offline
                      skywatch
                      last edited by skywatch

                      @Tag

                      It stopped getting data again just after 4.10AM this morning....

                      I don't really believe it is power supply problem. The 'internal' data still continues to flow without issue, just the rf side stops suddenly without reason. Also, I can still SSH in and do whatever I need to without problem. A psu issue would probably crash the entire pi, not just one data source.....

                      The pa/lna I have not seen with COB yet (the blob) - and no I don't have any with 'blobs' on them! 😉

                      Inclusion mode, I removed it all from the sketch and the associated HW. I will re-flash the GW today and post here exactly the code that goes into it. I may also try another pro-mini and this time solder to the board instead of adding dupont connectors, they can often be a pita! 😮 🙂

                      T 1 Reply Last reply Reply Quote 0
                      • T Offline
                        Tag MOD @skywatch
                        last edited by

                        @skywatch

                        Ah the pa/lna's are very very power hungry!!

                        Look at this thread, i have also read something about putting the radio on the 5v rail using a a stepdown converter that gets you from 5v to 3.3v.

                        Changing the power settings in mysensors.h is also an option

                        ifndef MyConfig_h
                        #define MyConfig_h
                        
                        /***
                         * Configure Sensor Network
                         */
                        #define RF24_CHANNEL	   76             //RF channel for the sensor net, 0-127
                        #define RF24_DATARATE 	   RF24_250KBPS   //RF24_250KBPS for 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS for 2Mbps
                        #define RF24_PA_LEVEL 	   RF24_PA_LOW    //Sensor PA Level == RF24_PA_MIN=-18dBm, RF24_PA_LOW=-12dBm, RF24_PA_HIGH=-6dBM, and RF24_PA_MAX=0dBm
                        #define RF24_PA_LEVEL_GW   RF24_PA_LOW  //Gateway PA Level, defaults to Sensor net PA Level.  Tune here if using an amplified nRF2401+ in your gateway.
                        #define BASE_RADIO_ID 	   ((uint64_t)0xA8A8E1FC00LL) // This is also act as base value for sensor nodeId addresses. Change this (or channel) if you have more than one sensor network.
                        
                        // MySensors online examples defaults
                        #define DEFAULT_CE_PIN 9
                        #define DEFAULT_CS_PIN 10
                        
                        
                        /***
                         * Enable/Disable debug logging
                         */
                        #define DEBUG
                        
                        #endif
                        
                        1 Reply Last reply Reply Quote 0
                        • skywatchS Offline
                          skywatch
                          last edited by skywatch

                          @Tag

                          Thanks for your input and suggestions....

                          RE: Radio - I tried with 2 different 'normal' radios with the printed antenna first. Still had the problem.
                          I moved to the pa/lna in a desperate attempt to see if it would help.
                          The current module gets it's power from a 662k regulator (with caps). Source is the 5V out and gnd on the pi. So should be plenty of available power for this board. The RF also has it's own 47uF cap directly soldered to the power pins (small smt tantalum rated at 6.3V).
                          In the code the level is set to #define RF24_PA_LEVEL RF24_PA_LOW - So again should be no problem.
                          The RF module is about 10cm+ away from the pi too....
                          Here is the full gw sketch added today with the latest dev branch freshly downloaded this morning....

                          // Enable debug prints to serial monitor
                          #define MY_DEBUG
                          
                          
                          // Enable and select radio type attached
                          #define MY_RADIO_NRF24
                          //#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
                          
                          // Enable serial gateway
                          #define MY_GATEWAY_SERIAL
                          
                          // Define a lower baud rate for Arduino's 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 60
                          // 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
                          
                          #include <MySensors.h>
                          
                          void setup()
                          {
                          	// Setup locally attached sensors
                          }
                          
                          void presentation()
                          {
                          	// Present locally attached sensors
                          }
                          
                          void loop()
                          {
                          	// Send locally attached sensor data here
                          }
                          

                          This is exactly what is in the gw.....

                          I have also put multiway connectors on the dupont cables as it should add more mechanical stability (just in case something happens with the wiring) - But again this would not explain why a power cycle gets it all going again... ???
                          Lets see how it goes now again.

                          1 Reply Last reply Reply Quote 0
                          • skywatchS Offline
                            skywatch
                            last edited by

                            Well this is strange indeed.

                            Last night all rf nodw data stopped arriiving at the controller again.

                            This time I simply power cycled the arduino gw and 50% of nodes started to display data again.

                            After half an hour this was still the case so I stopped and then started again MYC (no power off on the pi at all). Suddenly the remaining nodes started to show and this morning it's still looking good.

                            I'm still struggling with why this happens, especially as this would indicate it is neither the gw arduino or controller pi that is solely responsible.

                            Any ideas out there???

                            T 1 Reply Last reply Reply Quote 0
                            • T Offline
                              Tag MOD @skywatch
                              last edited by

                              @skywatch

                              Weird, but it seems to narrow down to the arduino + radio...
                              Have you seen this link, looks like the same iss you experience....

                              1 Reply Last reply Reply Quote 0
                              • skywatchS Offline
                                skywatch
                                last edited by

                                Which is kind of ironic as I moved to that setup due to the same issues with pi attached directly to radio. 3 different radio modules tested as well....

                                I will keep the external gateway as it allows for hardware signing for secure messages.

                                It doesn't narrow it down like that to me since it needed the myc controller to restart as well before things got back to normal.

                                /Maybe I'll add a hardware watchdog of some type, but it's difficult to decide what action it should take.

                                I noticed that there was no final solution on the mysensors site either. I wonder if it was ever resolved??

                                jkandasaJ 1 Reply Last reply Reply Quote 0
                                • jkandasaJ Offline
                                  jkandasa @skywatch
                                  last edited by

                                  @skywatch Do you have ESP8266 module? If yes you may give a try for WiFi/MQTT.

                                  1 Reply Last reply Reply Quote 0
                                  • skywatchS Offline
                                    skywatch
                                    last edited by skywatch

                                    Thanks -

                                    I now have made a new build of this. New arduino pro-mini (3.3v 8MHz), rf24 PA/LNA soldered to pro mini. Brand new 32Gb Sandisk SD card flahsed with latest raspbian (updated and upgraded) - Latest mycontroller 1.1.0-SNAPSHOT - Latest mysensors 2.2.0-rc.1 ......The result?

                                    Now I can't see any nodes at all! - I have tried to think what might be happening here.

                                    If I attach the arduino gw to the laptop and check in serial monitor I see data arriving from the sensors, so that looks to be working. But when I attach it to the pi I get nothing.
                                    MYC shows the gw serial connection as 'connected successfully', so where/what am I missing here?

                                    In raspi-config I selected serial = on ; serial console = off. I think thats right....?

                                    Thanks.

                                    T 1 Reply Last reply Reply Quote 0
                                    • T Offline
                                      Tag MOD @skywatch
                                      last edited by

                                      @skywatch

                                      So the story continues..... since the promini does not have a USB port, how is it connected to the PI?

                                      What is the output of:

                                      stty < /dev/<YOUR-DEVICE-FILE>
                                      

                                      Change <YOUR-DEVICE-FILE> with the device file you are using....
                                      It might be that it is set to 9600baud, while mysensors talks at 115200baud...

                                      1 Reply Last reply Reply Quote 0
                                      • skywatchS Offline
                                        skywatch
                                        last edited by skywatch

                                        @Tag

                                        pi@HAMASS:~ $ stty < /dev/serial1
                                        -bash: /dev/serial1: Device or resource busy
                                        

                                        Connection is from pi serial port to promini serial port. That's how it has been since I had to abandon the radio attached directly to pi version. I also added a brnad new raspberry pi 3 today as well....so eliminating hardware as much as possible.....

                                        I have even taken one node and cleared the eeprom and reflashed with the sketch and still I get gw connected but no nodes showing. This is driving me nuts!

                                        jkandasaJ T 2 Replies Last reply Reply Quote 0
                                        • jkandasaJ Offline
                                          jkandasa @skywatch
                                          last edited by

                                          @skywatch Can you try putty or some other tool to monitor serial port on your Raspberry PI?

                                          1 Reply Last reply Reply Quote 0
                                          • T Offline
                                            Tag MOD @skywatch
                                            last edited by Tag

                                            @skywatch

                                            Prior to running the stty command, did you stop mycontroller?

                                            The reason that you do not see any data comming in is most probably due to the fact that mycontroller locked the port...

                                            If you do not see anydata comming in it might be that mycontroller is listening at the wrong baud rate, are you using 115200 baud in mycontroller for your gateway?

                                            This is my setup:
                                            0_1511598862237_Screenshot 2017-11-25 at 09.33.24.png

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            0

                                            Online

                                            586

                                            Users

                                            529

                                            Topics

                                            3.4k

                                            Posts
                                            Copyright © 2015-2025 MyController.org | Contributors | Localization