Skip to content

Frijol/tessel-websocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tessel-websocket

Talk to Tessel over a websocket connection. This is a set of basic instructions for communicating to a Tessel from Node on your computer over a websocket connection.

Credit: This websocket demo is a simplification from this Neopixel-Tessel-websocket project by johnnyman727.

Setup

  1. Clone this repo, enter its directory and run npm install.
  2. Plug in Tessel to your computer.
  3. Connect Tessel to Wifi with tessel wifi -n network -p password. Be sure to connect your Tessel to the same network as your computer.
  4. Once Tessel is connected, run tessel wifi -l to get your Tessel's IP address.
  5. In client.js, set ipAddress as your Tessel's IP address.
  6. In your terminal, run tessel run server.js to start your Tessel listening.
INFO Deploying bundle (95.00 KB)...
INFO Running script...
Listening on port 8000
  1. In another window of your terminal, run node client.js to connect to your Tessel from your computer.
Connected to server! You may start typing  into the console.

In your server window, Tessel should also note the connection:

INFO Deploying bundle (95.00 KB)...
INFO Running script...
Listening on port 8000
Accepted new connection...
  1. In the terminal window running the client, type something and hit enter to send to Tessel:
Connected to server! You may start typing  into the console.
hi

Server-side response:

INFO Deploying bundle (95.00 KB)...
INFO Running script...
Listening on port 8000
Accepted new connection...
Got data: hi

Congrats! You now have a websocket connection from your computer to Tessel.

Troubleshooting

If you get disconnected, close the server and the client, reset the tessel, reconnect to wifi, and try again.

About

Basic websocket connection on Tessel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published