Navigation

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

    Best posts made by Coffeesnob

    • RE: Still not going well for me.

      @mfalkvidd, I have finally had the opportunity to reply to your question from a week back “Could you list the top 3-5 things that would have helped you the most, and where you would have expected to find that information? That would be great input.”
      Ok so I think the big thing is there is not a lot of detail in troubleshooting. Clearly the radios are the most problematic part and not being able to get access to how they actually work makes it very frustrating. The table that peterwill provided is very helpful but this also requires you to have some background information.
      I understand that you are trying to limit the amount of detail so as not to scare people away but I personally believe that having optional reference material would be extremely helpful. For example a diagram which explains how all the different liberties link together, this would have helped me to determine how the SPI components are setup.
      It would have been extremely helpful if in your initial radio setup guide you had a reference to how the SPI components of the radios work. This would be an optional reference that people could look at if they wanted to. At the moment, the way these radios work is very much black magic, and because I am new to the whole Arduino thing I was unable to determine if you are using the standard SPI features of the Arduino or if you had created your own. An example of a reference might be https://www.arduino.cc/en/reference/SPI however it is also important to explain that Mysensors is using its own SPI library, you could (should) go into more detail about how the SPI library is setup from the Mysensors point of view, because if you have to work it out your self this is very chanalgin because there is no common reference to understand how Arduino default SPI relates to mysensors SPI

      And finally, something which would make things oh so much easier, is a sample sketch that will just allow you to test the radios, i.e you type the number 1 into the serial monitor on the gateway and you will see a message on the node if the radios are all working. And vice versa. I am willing to take this on as a project as I am already working on it however I would ideally like it to use all the Mysensors library’s. In other words, it should behave like any other sensor network would. But I really need a lot more information to work out how to do this. In the meantime, once I get my radios back up and running again I will post a very quick and dirty version and let you have a look at it.
      I hope this all makes sense. I am a huge fan of the work the my sensors team have done here. I want to do what I can to help make it better.

      posted in Troubleshooting
      Coffeesnob
      Coffeesnob
    • RE: im brand new to MySensor and its not going well

      @mfalkvidd Thanks again for your reply, I greatly appreciate your efforts. So, I have made some good progress and now I think we are getting close. I discovered a bit of an anomaly in the way things are described on the website which doesn’t make it easy to understand how to connect things up when your first crack at this. It is probably worthwhile clarifying on this page https://www.mysensors.org/build/ethernet_gateway. So what I have discovered is that the page linked to above describes setting the NRF24L01 on pins A2,A1,SCK,CSN,CE however it also goes on to talk about potential conflicts with SPI, and to use alternative pins, however, it doesn’t really make it very clear how to do that.
      So here is what I did. I found a library called NRF24L01_h which was provided to me by Device.bit when I was looking at using their approach. By reading this I was able to get a much clearer understanding of how the SPI works and as you can see this file maps the NRF24L01 pins to 30,28,26,24,22 and 32 as the IRQ.

      #ifndef NRF24L01_h
      #define NRF24L01_h
      
      #include "API.h"
      
      //---------------------------------------------
      #define TX_ADR_WIDTH    5   
      // 5 unsigned chars TX(RX) address width
      #define TX_PLOAD_WIDTH  1  
      // 20 unsigned chars TX payload
      //---------------------------------------------
      #define CE       22
      // CE_BIT:   Digital Input     Chip Enable Activates RX or TX mode
      #define CSN      24
      // CSN BIT:  Digital Input     SPI Chip Select
      #define SCK_PIN      26
      // SCK BIT:  Digital Input     SPI Clock
      #define MOSI_PIN     28
      // MOSI BIT: Digital Input     SPI Slave Data Input
      #define MISO_PIN     30
      // MISO BIT: Digital Output    SPI Slave Data Output, with tri-state option
      #define IRQ      32
      // IRQ BIT:  Digital Output    Maskable interrupt pin
      //*********************************************
      #endif
      
      

      So I started to re-write the example code to user this but in doing so I discovered these lines of code in the example script and then the penny dropped.

      #if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
        #define MY_SOFTSPI
        #define MY_SOFT_SPI_SCK_PIN 14
        #define MY_SOFT_SPI_MISO_PIN 16
        #define MY_SOFT_SPI_MOSI_PIN 15
      #endif  
      
      // When W5100 is connected we have to move CE/CSN pins for NRF radio
      #ifndef MY_RF24_CE_PIN 
        #define MY_RF24_CE_PIN 5
      #endif
      #ifndef MY_RF24_CS_PIN 
        #define MY_RF24_CS_PIN 6
      #endif
      
      

      0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;TSM:RADIO:OK
      0;255;3;0;9;TSM:GW MODE
      0;255;3;0;9;TSM:READY
      IP: x.x.20.12

      So we are away. The radio is working and now I am starting to understand how the code works a little better….however!!!!

      In the Ethernet code there is a line #define MY_PORT 5003 which is what mynode will connect to. Only issue now is this port doesn’t seem to be open or it is in the wrong mode somewhere deeper in the code. If I load the example code for Chat server. And set the port to 5003 then my node can connect to the Mega no problem. So I know it's not firewall or hardware or in fact network related. Can you point me in the right direction to troubleshoot this please. i suspect the issue will be in one of the libraries further down the line.

      posted in Troubleshooting
      Coffeesnob
      Coffeesnob
    • RE: Still not going well for me.

      @petewill, you sir are a star... this was the information I was missing and it is now working as expected. below is the serial monitor trace from both the Mega and the Uno.

      First the Mega

      0;255;3;0;9;MCO:BGN:STP
      0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
      0;255;3;0;9;TSF:MSG:READ,10-10-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
      0;255;3;0;9;TSF:MSG:SEND,0-0-10-10,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
      0;255;3;0;9;TSF:MSG:READ,10-10-0,s=1,c=1,t=16,pt=0,l=1,sg=0:1
      0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;TSF:WUR:MS=0
      0;255;3;0;9;TSM:INIT:TSP OK
      0;255;3;0;9;TSM:INIT:GW MODE
      0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;MCO:REG:NOT NEEDED

      and this is the Uno...
      8994 TSF:MSG:SEND,10-10-0-0,s=1,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=OK:1
      9000 MCO:SLP:MS=120000,SMS=0,I1=1,M1=1,I2=255,M2=255
      9006 MCO:SLP:TPD

      I have literally spent hours on this. I think the documentation in terms of getting started needs to be expanded on considerably. I get this is a huge task but if you don't know much about Arduino or know where to look you pretty much screwed.

      posted in Troubleshooting
      Coffeesnob
      Coffeesnob
    • RE: Still not going well for me.

      Thanks heaps @Hek and @petewill I didn't realise that without the controller running I will not get a node id. I thought incorrectly the node id came from the gateway. I booted up MYSController and it now works as expected. thanks for pointing me in the right direction..

      cheers until next time.

      posted in Troubleshooting
      Coffeesnob
      Coffeesnob