Navigation

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

    Coffeesnob

    @Coffeesnob

    5
    Reputation
    19
    Posts
    478
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online

    Coffeesnob Follow

    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

    Latest posts made by Coffeesnob

    • RE: Mysensor Serial with OpenHab2 how to please....

      @TimO .. perfect thanks very much. this is the missing part.

      posted in OpenHAB
      Coffeesnob
      Coffeesnob
    • RE: Mysensor Serial with OpenHab2 how to please....

      @gohan that's a great suggestion. The short answer is because I have no idea how to do that. As I said in my last post I'm not a Linux guy and while I like to think I'm pretty intelligent, with your suggestion I would not know where to begin. Having said that it is a great idea, less parts= less things that can go wrong.

      posted in OpenHAB
      Coffeesnob
      Coffeesnob
    • Mysensor Serial with OpenHab2 how to please....

      Re: openHAB 2.0 binding

      Greetings, I am very new to openHAB. I think I might like it but I am struggling a lot with the gaps in documentation. which is why I'm posting here.
      my setup is openHABian running on a Raspberry Pi v 1b, openHab is running perfectly and i can control network devices such as Wemo switches, I have Mysensor v2 running on a Nano with 5 nodes, these are all working perfectly with my very old and slow Vera 2.
      I am using a serial gateway because this suites my setup better than Ethernet. I figure I have Raspberry Pi that has power and Ethernet, my not use it to power the Arduino as well. Besides that, I have not been able to successfully get the Ethernet gateway on Mysensor to work. But that’s another battel for another day.
      So here is my question. How do I configure OpenHab v2 to use the USB port to talk to Mysensor? There is no description on how to configure Mysensor to work serially with Openhab 2. there is a basic description on how to do it for v1.x but this is not at all helpful because OpenHab 2 doesn't use openhab.cfg

      The screenshot below shows the Mysensor Serial configuration page, but I don’t know what to put here.

      ![alt text](0_1492564538490_upload-4aec4721-a0d7-4a0e-9333-e131d00e824a image url)

      In case its not obvious. I’m not a Linux guy, so what may be obvious to anybody who is a Linux guy is not remotely obvious to us windows dudes.
      Thanks in advance for your help.

      posted in OpenHAB
      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
    • RE: Still not going well for me.

      Ok, so the new hardware has finally arrived and I have been pulling my hair out trying to get it working. It appears like there is something wrong in the way the node and the gateway are setting up. I didn't have this problem a couple of weeks ago but since I have upgraded to v2.1.1 the problem has manifested. I have seen that there are a number of posts that appear to have similar issues but not exactly the same. Perhaps somebody can shed some light.

      The setup is still exactly the same as I have described earlier in this post. I have a Mega and a Nano both with NRF24L01, I have a 10uf Cap across the power supplies of both radios, and I am 100% sure that the radios and the Arduinos are all working because I have built a NON Mysensor test sketch to prove this is all fine. Aside from that you can also see from the log transcript below that the units are actually talking. They just don’t seem to be able to complete the negotiation.

      So here is what I am seeing. in the log transcript below you can see that the two devices are talking to each other. the Bold text are the messages being sent from the gateway and the normal text is the messages being sent from the Node.

      0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.1
      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
      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.1.1
      0;255;3;0;9;MCO:BGN:STP
      0;255;3;0;9;MCO:BGN:INIT OK,TSP=1

      0 MCO:BGN:INIT REPEATER,CP=RNNRA--,VER=2.1.1
      3 MCO:BGN:BFR
      5 TSM:INIT
      6 TSF:WUR:MS=0
      12 TSM:INIT:TSP OK
      14 TSM:FPAR
      16 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:

      0;255;3;0;9;TSF:MSG:READ,255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      0;255;3;0;9;TSF:MSG:BC
      0;255;3;0;9;TSF:MSG:FPAR REQ,ID=255
      0;255;3;0;9;TSF:CKU:OK,FCTRL
      0;255;3;0;9;TSF:MSG:GWL OK
      0;255;3;0;9;TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0

      89 TSF:MSG:READ,0-0-255,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      94 TSF:MSG:FPAR OK,ID=0,D=1
      2023 TSM:FPAR:OK
      2024 TSM:ID
      2025 TSM:ID:REQ
      2027 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:

      0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
      255;255;3;0;3;

      4035 TSM:ID
      4036 TSM:ID:REQ
      4038 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:

      0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
      255;255;3;0;3;

      4035 TSM:ID
      4036 TSM:ID:REQ
      4038 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:

      0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
      255;255;3;0;3;

      4035 TSM:ID
      4036 TSM:ID:REQ
      4038 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:

      0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
      255;255;3;0;3;

      10066 !TSM:ID:FAIL
      10067 TSM:FAIL:CNT=1
      10070 TSM:FAIL:PDT

      What you can clearly see here is that the initial node setup takes place, the request from the node to the gateway is received by the gateway and it reply’s. the node receives the reply and then it sends its reply, the Gateway receives the reply and then try to send an acknowledgment, but the node never gets the message. I suspect this is because the message being sent from the gateway is incomplete for some reason.

      For example the Node sends

      4038 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:

      The gateway responds with
      0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:

      Which in and of its self doesn’t look exactly right to me, but as I am not the expert in this I am probably wrong.

      The gateway then prints 255;255;3;0;3; with nothing else in the line, this looks to me like its trying to send something but the message is empty.

      What are your thoughts? @mfalkvidd and @petewill I am hoping you guys can shed some light here.

      Thanks in advance.

      posted in Troubleshooting
      Coffeesnob
      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: Still not going well for me.

      @tekka, will do. I have had a hardware related issue that is unrelated to this directly. (i bricked my Nano trying to flush the eprom) but it means that until I get this fixed or get new hardware I am not going to be able to do anymore. Im hoping that Im getting close because this is really getting pretty frustrating.

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

      @petewill, yep you would think that would do it... however, it doesn't seem to work. what is interesting is if I send a 1 it also doesn't turn on the relay, only sending an empty message turns it on. I think I might post in the MYSController forum to see if they have any ideas.

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

      @mfalkvidd, I can post here no problem. but I also want to provide a how-to of sorts that will help newbies like me to rule out anything that is Mysensors related. I just thought this would require me a to PM you

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

      @petewill, appreciate it. I'm very happy with the outcome, for the most part. However, I now have a new challenger. I am using a relay module and I can happily turn relays on using MYSController but can't seem to figure out how to turn them off. I know you know a little about this product so I wonder if you can point me in the right direction.
      I have also connected to my gateway serially using HomeGenie and it can't turn either on or off. but I haven't had time to do any further fault finding there yet.

      As soon as I have time, I will provide promised doc. i then need to know where to send them.

      posted in Troubleshooting
      Coffeesnob
      Coffeesnob