Hi,
I am trying to enter command mode on a XBee module using the hserout command - with no success.
I am using the following code:
I have tried foreground & background receive modes. I have varied the pause times and I have run simple test programs that send and receive data perfectly OK.
But I want to remotely get the Xbee serial number and I need to get into command mode to retreive it - which I cannot seem to do.
Previously, on another board, I was not using hardware serial and with the serout and serin commands it worked OK. Now that I have migrated to hardware serial in an attempt to get a higher baud rate, I can't seem to enter command mode.
Has anyone else achieved this or is there some issue I am not aware of?
Any help appreciated.
Cheers
I am trying to enter command mode on a XBee module using the hserout command - with no success.
I am using the following code:
Code:
hSerSetup B2400_4, %00 'foreground receive
pause 5000
'put dummy data into scratchpad
put 0, "#","#","#","#"
ptr = 0
hserptr = 0
b0 = 0
get_RF_id:
inc b0
hserout 0, ("try no.:",#b0,CR,LF)
pause 10000 'allow plenty of quiet time
hserout 0,("+++") 'send cmd characters
hserin [10000, get_RF_id], 0,2 'should get an "OK" response
pause 10000 'allow plenty of time to exit cmd mode
ptr = 0
hserout 0, (@ptrinc,@ptrinc,@ptrinc,@ptr,CR,LF) 'send what should be "OK##"
goto get_RF_id
But I want to remotely get the Xbee serial number and I need to get into command mode to retreive it - which I cannot seem to do.
Previously, on another board, I was not using hardware serial and with the serout and serin commands it worked OK. Now that I have migrated to hardware serial in an attempt to get a higher baud rate, I can't seem to enter command mode.
Has anyone else achieved this or is there some issue I am not aware of?
Any help appreciated.
Cheers