-
1Setup Enviornment
First, we make sure the correct Ameba development board is set in “Tools” -> “Board”
Then, open the Simple WiFi Server example in “File” -> “Examples” -> “AmebaWiFi” -> “SimpleServerWiFi”
In the sample code, modify the highlighted parameters and enter the ssid and password for your WiFi connection.
-
2Upload code
Next, upload the code, then press the reset button on Ameba. Afterwards, you will see the connection information is displayed in the serial monitor.
-
3Setup client
Next, we use the socket tool in the laptop to be the client and connect to the IP address of the Ameba board shown in the connection information at port 5000. (Note: The socket tool we used in this example is “sokit”).
Click on the “Client” tab to choose the client mode, specify the IP and port of the server, then click “TCP Connect”.
If the connection is established successfully, the server shows a message: “A client connected to this Server”, and the IP and port of the connected client.
-
4Establish connection
In this example, when the client and server are connected and the client sends a string to Ameba server, the Ameba server returns the identical string back to the client.
The string sent to server is returned and showed at the client side.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.