Navigation

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

    Posts made by Squint

    • RE: Radio setup give: "check wires"

      @olaeke It turns out mine were actually + models. I had the sensors wired incorrectly because I had SOFTSPI enabled.. Once I realized the correct pinout ( After about 3 days of trial/error/code-digging ) its now reporting the + as it should and the radios are working as intended.

      Thanks!

      posted in Troubleshooting
      Squint
      Squint
    • RE: "Check Wires!!!" - N00B needs some help (please)

      @hek Its missing the note that once you enable SOFTSPI the default sensor documentation is wrong, and that you either need to maintain two versions of the MySensors library or wire your radio the same as the gateway. My issue was that I wired the sensors the same as the documentation in the sensors docs and it doesnt work because SOFTSPI is enabled.

      Alternatively, there should be a IS_GATEWAY defined for gateway code that enables SOFTSPI by default or move the SOFTSPI definition into the gateway code , then the documentation could in fact be correct.

      posted in Troubleshooting
      Squint
      Squint
    • RE: "Check Wires!!!" - N00B needs some help (please)

      OK - I have it all worked out!!!

      For the N00BS who would like to not have to spend 3 days reverse engineering the code.. Here are some key tidbits that I couldn't find documented anywhere..

      1: Enable on the gateway for MqTT or Ethernet GW

      To do this you need to uncomment the line below in utility/RF24_config.h:

      //#define SOFTSPI   // Requires library from https://github.com/greiman/DigitalIO
      

      You only uncomment this line, DO NOT UNCOMMENT SPI_UART as well ( This caused me a days worth of trying to work out what I did wrong )

      IMPORTANT: This file effects the entire library, so if you enable this it effects your sensors as well.

      2: Wire for SOFTSPI
      Because you've now just enabled SOFTSPI, you need to wire your project accordingly. The default wiring diagrams that are noted everywhere are not valid anymore..

      the code is now using the following changes:

       //These are default, but you can change them if you like:
       const uint8_t SOFT_SPI_MISO_PIN = 16;
       const uint8_t SOFT_SPI_MOSI_PIN = 15;
       const uint8_t SOFT_SPI_SCK_PIN = 14;
       const uint8_t SPI_MODE = 0;
      

      3: Validate your radios

      The best thing to do once you've wired up your radios is to dump out the config. This will allow you to validate the wiring is correct and let you know if you've done anything wrong.

      The best way to do this is to add a RF24::printDetails(); line into MySensors.cpp like this:

      open the MySensors.cpp file and locate the line that looks like this:

       MySensor::setupRadio(rf24_pa_dbm_e paLevel, uint8_t channel, rf24_datarate_e dataRate)
      

      at the bottom of the block add RF24::printDetails(); like this:

      void MySensor::setupRadio(rf24_pa_dbm_e paLevel, uint8_t channel, rf24_datarate_e dataRate) {
          failedTransmissions = 0;
      
          // Start up the radio library
          RF24::begin();
      
          if (!RF24::isPVariant()) {
                  debug(PSTR("check wires\n"));
                  while(1);
          }
          RF24::setAutoAck(1);
          RF24::setAutoAck(BROADCAST_PIPE,false); // Turn off auto ack for broadcast
          RF24::enableAckPayload();
          RF24::setChannel(channel);
          RF24::setPALevel(paLevel);
          RF24::setDataRate(dataRate);
          RF24::setRetries(5,15);
          RF24::setCRCLength(RF24_CRC_16);
          RF24::enableDynamicPayloads();
      
          // All nodes listen to broadcast pipe (for FIND_PARENT_RESPONSE messages)
          RF24::openReadingPipe(BROADCAST_PIPE, TO_ADDR(BROADCAST_ADDRESS));
          RF24::printDetails();
      }
      

      If the output shows all 0's or all FF's, then your wiring is in-correct and the radio is not initializing correctly.

      4: You've done all this, but you're still receiving an error check wires:

      This either means you've not initialized the board correctly and the wiring is still incorrect OR you have a non-Plus radio ( RF24L01 vs RF24L01+ )
      To check this, comment out the while(1) line in the MySensors.cpp file like this:

          if (!RF24::isPVariant()) {
                  debug(PSTR("check wires\n"));
                  //while(1);
          }
      

      This will alow the initialization to proceed if the device is not a plus version, this way the printDetails() code you've added will be triggered and you can continue to investigate.

      IMPORTANT NOTE:

      The printDetails() output will only show that you have a plus version of the radio if its wired correct and is initializing. If its not initialized, it will not show the proper version of the radio. I had this and spend a day updating code to support a different data rate when it was un-necessary.

      Hopefully this is helpful information and thank you everyone who chipped in some info to giude me to these conclusions..

      Admins: I would highly recommend you guys explain the SOFTSPI bits within the documentation for the Ethernet/MqTT gateways - If it was documented well I think i would have had a lot less trouble. Just my 2 cents. 🙂

      posted in Troubleshooting
      Squint
      Squint
    • RE: MQTT Gateway - works, pings but no messages while listening to broker

      @cayco Those lines are just the data that is being received/transmitted through the Ethernet module and its showing as HEX.
      If you convert the hex to ascii you can see what it is..

      In your example you are getting: "**$MQIsdp<mosq_sub_5877_magdalen**"

      Here is a good tool: http://www.asciitohex.com/

      posted in Troubleshooting
      Squint
      Squint
    • RE: Radio setup give: "check wires"

      @olaeke I believe this is how I have mine setup as well.. Oddly enough both modules have the "+" printed on the chip but I cannot get the sensor code to initialize unless i take out the PVariant check. printDetails shows the following:

      Gateway:
      Data Rate = 2MBPS
      Model = nRF24L01+

      Sensor:
      STATUS = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
      RX_ADDR_P0-1 x00 = 0x0000000000 0x0000000000
      RX_ADDR_P2-5 x00 = 0x00 0x00 0x00 0x00
      TX_ADDR = 0x0000000000
      RX_PW_P0-6 x00 = 0x00 0x00 0x00 0x00 0x00 0x00
      EN_AA = 0x00
      EN_RXADDR x00 = 0x00
      RF_CH = 0x00
      RF_SETUP x00 = 0x00
      CONFIG = 0x00
      DYNPD/FEATURE x00 = 0x00 0x00
      Data Rate = 1MBPS
      Model = nRF24L01
      CRC Length = Disabled
      PA Power = PA_MIN

      The odd part is, on the sensor - all of the values in printDetails(); are 0's.. So I suspect I have something wired incorrectly?
      I've double & tripple checked the wiring..

      Thanks.

      posted in Troubleshooting
      Squint
      Squint
    • RE: "Check Wires!!!" - N00B needs some help (please)

      @hek Thank you for the response.

      I've properly enabled the softspi now and updated the power as you mentioned, the gateway seems to now be working, or at least its reporting "Started!" and I can ping / telnet to the MQTT server.

      Now I am working on a distance sensor as my first sensor. It too says its working, and I see the V_DISTANCE value's being spit out at the serial console on the sensor itself, but It doesn't appear that the gateway is receiving any of the data.

      In order to get the sensor working I've had to change the Bit Rate to 2MB as per the thread here:
      http://forum.mysensors.org/topic/728/radio-setup-give-check-wires/30

      I changed the bitrate in the MyConfig.h
      #define RF24_DATARATE RF24_2MBPS

      If I do this, does this change the bitrate for the MQTT gateway as well? or is there somewhere else I would need to change it?
      I've grep'd the code for RF24_2MBPS and cant seem to find anywhere else..

      If they are both running at 2MB, they should be talking to each other.. correct?

      Thank you in advance and sorry for the long post.

      posted in Troubleshooting
      Squint
      Squint
    • RE: Radio setup give: "check wires"

      @olaeke Can you explain why the controller needs to be "+" ?

      If we follow the speed change from the post above, does it also effect the Controller speed?

      I've just managed to get a sensor going ( non+, via the hack here at 1MB ).. ( My Chip actually shows a +, but printDetails(); shows no +
      My Controller/Gateway also is supposed to be "+", however printDetails(); shows its not + either..

      Is there a chance, I have it setup wrong and it defaults to non+ in the printDetails() output?
      The Controller doest startup and say "Started!"..

      posted in Troubleshooting
      Squint
      Squint
    • RE: Ardunio n00b needs some help!

      @mvader said:

      0;0;3;0;9;check wires

      FYI: 0;0;3;0;9;check wires means that the wireless module cannot be initialized. When it starts up, it does a validation check, if that check fails, you will receive the "check wires" message.

      This means you either have the module wired incorrectly or you need to enable SOFTSPI as @ericvdb mentions.

      I just went through the exact same scenario and after about 2 days of tweaking, I finally got a "Started!" message.

      Hang in there, you'll get it. 🙂

      posted in Troubleshooting
      Squint
      Squint
    • RE: Ardunio n00b needs some help!

      @ericvdb If you enable SOFTSPI in the MySensors Library, does that also effect the Sensors or only the Gateway code? Is there anything different you would need to do for the Sensors?

      posted in Troubleshooting
      Squint
      Squint
    • "Check Wires!!!" - N00B needs some help (please)

      Hi there everyone.

      Firstly - Thank you for taking the time to read this and potentially offer me some guidance..

      Secondly - I am a newb when it comes to MySensors - I think this is a great project and I look forward to assisting the community with this project in the future.

      **My Problem
      **
      I've (Almost) successfully managed to build an MQTT Gateway ( I had it "Started!" and managed to ping the IP and connect to it with OpenHAB for about 30 minutes, now it wont start again, but thats not my current problem. ).. Once I managed success with the Gateway, I moved on to building a sensor....

      No matter what configuration I try I ALWAYS, ALWAYS, ALWAYS get the message "check wires".. I've tried many things including:

      • Different wireless modules ( I have 3, and I've even tried the one thats currently working on the gateway ).
      • Different pin-out configurations
      • Enabled / Disabled SOFTSPI ( Currently Enabled in my IDE Libs)
      • Checked the pinouts 100 times and even re-did them from scratch at least 3 times...
      • Enabled / Disabled SOFTSPI

      Essentially, I am at a loss of what to do next.

      • I have enabled SOFTSPI, is there anything special I need to do with regards to enabling/using it with the sensors?
      • I have all the latest Libs from MySense
      • Is there extended Debug I can enable?

      Environment:

      Arduino: Arduino Nano V3
      Controller: MQTT by OenHab
      Senesor: Distance sensor

      posted in Troubleshooting
      Squint
      Squint