This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Closed

Help needed on a first nRF905 app

lexlex Member

I am trying to develop a homey-app that will be able to communicate with an arduino.

As a base I stripped down an example program until I kept one action for this app: changing the led-colors. I could install and run this from within the flow editor.  B) 
Btw: My tools are notepad++, node, npm and git.

As the next step, I wanted to add the nRF905 functionality and followed the text in https://github.com/athombv/node-homey-arduinodriver

First I got runtime errors like “cannot find module ‘homey-arduinodriver’”. I copied the homey-arduinodriver from the node_modules directory (which is outside my project directory), into my project directory.  Maybe this is my first mistake (because why should one bring a global library into a specific project?), but hereafter this error didn’t occur anymore. :)

But now a new error arises:
Error: invalid_signal_id:nRF905
  at new Signal (/homey-app/various/rf.js:44:12)
  at new ArduinoRadio (/homey-arduinodriver/lib/arduino_radio.js:29:21) ....

Any suggestions?

Comments

  • You need to add signal to app.json. see https://github.com/athombv/node-homey-arduinodriver/blob/master/signal.json
    Also you should install lib using npm install. Re-read readme.
  • I have the nRF905 wired up (and checked four times). Homey App running and sketch running without errors, but don't get them to communicate. Both nRF905 cards I received may be death.
  • lexlex Member
    MatjaLipu said:
    I say this reluctantly: you are right!  :D  
    Thank you!
  • lexlex Member
    I have the nRF905 wired up (and checked four times). Homey App running and sketch running without errors, but don't get them to communicate. Both nRF905 cards I received may be death.
    ErikVanDongen : I also wasn't able to set up any RF communication between Homey and Arduino (using the nRF905 module) . :|
      
    I have some helper program for my Arduino's that I used for analyzing RF 433 remote signals (to let Arduino copy those signals). As a receiver the simple SR309H is used.
    I am perfectly able to 'see' kiku/coco signals transmitted from Homey (and other 433 MHz signals floating around this household), but I do not see any signals generated  by my first Homey app. 
    It might well be that I miss the Homey signal with the SR309H for some reason: an other frequency used by Homey than I expect, a pulse width outside my expectations, etc.
    But, I am not convinced my Homey app really transmits anything...  :/
  • ErikVanDongenErikVanDongen Member
    edited August 2016
    @lex Receiving on Arduino is now working after a change in the signal definition (https://github.com/athombv/node-homey-arduinodriver/issues/1). 
    ACK or other data from arduino to homey is not working yet.
  • lexlex Member
    @lex Receiving on Arduino is now working after a change in the signal definition (https://github.com/athombv/node-homey-arduinodriver/issues/1). 
    ACK or other data from arduino to homey is not working yet.
    ErikVanDongen Thank you for pointing out. :)
    Lowering of the carrier frequency with 14 kHz didn't help me. Nor with the nRF905, nor with the SR309H.
    And next to that, I don't believe my simple SR309H is that sensitive for the exact carrier frequency. I think I still have my same issue to resolve. 

    To be continued in the next episode.   B)
  • srry,, I might be stupid as f*ck. but what did I do wrong.. .

    I got: Invalid JSON in app.json [SyntaxError: Unexpected string]

    just added signals to it...
    {
        "id": "nl.test.sensortest",
        "name": {
            "en": "test"
        },
        "version": "0.0.1",
        "compatibility": "0.X",
        "author": {
            "name": "Mark van Winden",
            "email": "SPAMMEBABY@gmail.com"
        }
     
        "signals": {
                "433": {
                    "nRF905":{
                        "sof": [1,1,1,1,0,0,1,0,1,0,1,0,1,0,1,0,1,1,0,0,1,1,0,0,1],
                        "words": [
                            [1, 0],
                            [0, 1]
                        ],
                        "eof": [],
                        "manchesterUnit": 10,
                        "manchesterMaxUnits": 10,
                        "carrier": 433934000, 
                        "repetitions": 200,
                        "sensitivity": 1.0,
                        "interval": 500,
                        "packing": true,
                      "rxTimeout": 200,
                        "modulation": {
                            "type": "GFSK",
                            "baudRate": 100000,
                            "channelSpacing": 100000,
                            "channelDeviation": 50000
                        }
                }
            }
        }
    }
        

  • Its look like a silly remark but I had problems with Notepad++ character choice of ANSI by PHP7 programming.
    After long searching I found it had to be UTF-8 (without BOM).
     

  • srry,, I might be stupid as f*ck. but what did I do wrong.. .

    I got: Invalid JSON in app.json [SyntaxError: Unexpected string]

    just added signals to it...
    {
        "id": "nl.test.sensortest",
        "name": {
            "en": "test"
        },
        "version": "0.0.1",
        "compatibility": "0.X",
        "author": {
            "name": "Mark van Winden",
            "email": "SPAMMEBABY@gmail.com"
        }
     
        "signals": {
                "433": {
                    "nRF905":{
                        "sof": [1,1,1,1,0,0,1,0,1,0,1,0,1,0,1,0,1,1,0,0,1,1,0,0,1],
                        "words": [
                            [1, 0],
                            [0, 1]
                        ],
                        "eof": [],
                        "manchesterUnit": 10,
                        "manchesterMaxUnits": 10,
                        "carrier": 433934000, 
                        "repetitions": 200,
                        "sensitivity": 1.0,
                        "interval": 500,
                        "packing": true,
                      "rxTimeout": 200,
                        "modulation": {
                            "type": "GFSK",
                            "baudRate": 100000,
                            "channelSpacing": 100000,
                            "channelDeviation": 50000
                        }
                }
            }
        }
    }
        

    missing a comma before signals. You can use online json validators. 
  • Ow man.. see. To damn simpel....thnx
  • lexlex Member
    lex said:

    Lowering of the carrier frequency with 14 kHz didn't help me. Nor with the nRF905, nor with the SR309H.
    And next to that, I don't believe my simple SR309H is that sensitive for the exact carrier frequency. I think I still have my same issue to resolve. 

    To be continued in the next episode.   B)
    This weekend I restarted where I left in august with the the Arduino - Homey coupling. I inserted lots of debug statements to find out what was going on. I encountered un-initialized stuff and realized my HomeyRadio() object had a too limited scope. After moving the definition to the top of my app.js, my arduino received the messages. Yeah! B)

    But, as other mentioned before, the ACK of Arduino after receiving is never handled by Homey. That's a pity, since I cannot be sure my flow really triggered Arduino to do something.  :'(
    Btw: by using a RF sniffer I am sure the Arduino emits an ACK, but my debug lines in arduino-radion.js don't show a reaction on that. 
     
    And I am still puzzled how to send information from Arduino to Homey. I understand any communication has to be initialized by Homey, but in my case it is no problem to let Homey poll Arduino every minute.
    Is someone willing to share their working example? 
     
  • Not have seen a working Arduino > Homey example yet...
This discussion has been closed.