Home/Support/Support Forum/java script websocket API and xbee wifi

java script websocket API and xbee wifi

0 votes
I'm running a tomcat server and I'm trying to control an Xbee WiFi module connected to the wifi network. Im using java script WebSocket API and im able to open a TCP connection and close the connection but i cant send any data which has got me wondering, can the Xbee module accept the java websocket class?
Im not connecting any embedded system to the xbee wifi module and im purely trying to send a hex command to set an i/0 port high.
asked Jan 28, 2015 in XBee Programmable Development by aprykea New to the Community (0 points)
edited Jan 28, 2015 by aprykea

Please log in or register to answer this question.

1 Answer

0 votes
Yes, the XBee WIFI S6B module can send and receive data over any TCP or UDP socket providing you use the correct port numbers.

Now you just can't issue a Hex command to set a remote line high or low. You do need to send the proper API frames as well. to help you figure out where the issue is, I would suggest trying to send data between two WIFI modules.
answered Jan 28, 2015 by mvut Veteran of the Digi Community (11,302 points)
my server will connect to an online server though but wont connect to the xbee? and yes sorry I did mean an API frame.
What are the DE and CO commands set to on the XBee?  What port numbers are you sending and listening on with your server? Does the AI value show that the radio is associated to a gateway?
My source and destination ports on the xbee are set to 50 (which is in hex so that's port 80?) and my server is sending on port 80 too. The AI value is showing a success too. My device connects to the WiFi router and I can see packets on wire-shark being sent back and forth when I try to open the connection, and when I close it. However when I try to send anything it doesn't like it. I don't think the connection is being successfully opened.
Yes that is Hex 80.  Try using a telnet software such as Hercules to test with,.  It should help you determine where the issue is.
...