Professional Documents
Culture Documents
DOC-20240424-WA0002. (G)
DOC-20240424-WA0002. (G)
DATE: MEDIUM
AIM:
APPARATUS REQUIRED:
• RASPBERRY PI 3model B+
• ARDUINO UNO
• ESP8266(wifi module)
• JUMPER WIRES
SOFTWARE REQUIRED:
• THONNY ID
• ARDUINO SOFTWARE
THEORY:
RASPBERRY PI:
ESP8266(WIFI MODULE):
Procedure:
3.type and compile the program in Arduino software. Here we can check the serial function
using softwareserial. H
6.Then move to thonny IDE and type the python program and run it.
7.Now here the comment which type in Arduino is send to esp8266 and in module(Through
wireless) the comment is send to raspberry
Void setup()
Serial.begin(9600);
Void loop()
Serial.write(“jones\n”);
Delay(1800);
#include <ESP8266WiFi.h>
Char message;
Void setup() {
Serial.begin(9600);
Delay(10);
Serial.println();
Serial.print(“Connecting to “);
Serial.println(ssid);
WiFi.begin(ssid, password);
Delay(500);
Serial.print(“.”);
Serial.println(“”);
Serial.println(“WiFi connected”);
Serial.println(WiFi.localIP());
Serial.end();
}
Void loop()
WiFiClient client;
If (!client.connect(host, port))
Serial.println(“Connection failed”);
Delay(5000);
Return;
String s=Serial.readString();
Client.println(“jones”);
Client.stop();
Import socket
HOST=’192.168.120.49’#Raspberry ip address
PORT=8080
s. blind((HOST, PORT))
s.listen()
print(‘waiting for connection… ‘)
conn, addr=s.accept()
with conn:
while true:
data=conn.recv(1024)
if not data:
break
RESULT: