mozz100 / node-xbee

Node.js talks to xbee radios. JS robots and automation FTW
48 stars 25 forks source link

[request] - RSSI example? #3

Closed stevenrace closed 11 years ago

stevenrace commented 12 years ago

Howdy, this is a neat project.

So as my 'hello world' interpretation, I decided to check RSSI of a remote radio. Looking through XTCU (Digi's firmware tool), it seems that code is 'P0' and is enabled on my radio as such.

So I modified 'example.js' with my radio's address and swapped the remote AT command to 'P0'.

The data I get back is always the same:

xbee data received: Remote AT Response
/n data:  { type: 'Remote AT Response',
  frameId: 2,
  remote64: 
   { dec: [ 0, 125, 51, 162, 0, 64, 118, 53 ],
     hex: '007d33a200407635' },
  remote16: { dec: [ 62, 231 ], hex: '3ee7' },
  command: '3P',
  commandStatus: 48,
  commandData: [ 0 ],
  bytes: [ 151, 2, 0, 125, 51, 162, 0, 64, 118, 53, 62, 231, 51, 80, 48, 0 ] }

Any input as to what I may be doing wrong?

mozz100 commented 12 years ago

Thanks for the message; good to know others are using this. It's been a while since I looked at it, so I am a bit rusty.

I should also highlight the svd-xbee work that jouz has done; he's taken things a lot further and is well worth looking at if you are starting out.

Anyway - back to your situation - it is peculiar because the response data contain a different command "3P". Also the non-zero commandStatus indicates things didn't work for you.

I think sending a remote command "P0" with no commandData (second parameter null) is requesting the state of PWM0 (pin 6).

Step back and confirm that simple things are working. You should be directly connected (USB) to an xbee module that's programmed to run in API mode? Does the AT("ID") command (line 27) of example.js return what you'd expect? (It should return the PAN ID for the directly-connected xbee module). If not, what does it return? If that works, try

 RemoteAT('ID', null, remote64, remote16);

What does that return?

mozz100 commented 12 years ago

@stevenrace How did you get on with this? I spent some time working with node and xbee this weekend and using jouz's code, which builds upon what's here. Well worth a look:

https://github.com/jouz/svd-xbee

mozz100 commented 11 years ago

Closing issue after 3 months of inactivity.