top of page

Forum Comments

BiBoard Serial Port
In Hardware
Reid Graves
Jun 14, 2024
Following up on this post, I'm still trying to get the Tx and Rx pins on the ESP32 to work for serial communication with a raspberry pi. I've noticed that the OpenCatEsp32.ino file has this in the setup loop: void setup() {   // put your setup code here, to run once:   Serial.begin(115200);  // USB serial   Serial.setTimeout(SERIAL_TIMEOUT);   // Serial1.begin(115200); //second serial port   while (Serial.available() && Serial.read())     ;  // empty buffer   initRobot(); } Where the line that is commented out has a comment that this is for the second serial port, while the first Serial.begin statement is commented to be for the USB serial. I tried removing the comment, however the board is unresponsive when I do this. Additionally, I've been able to test the serial communication with this .ino file: void setup() { Serial.begin(115200); // Initialize Serial for debugging Serial2.begin(4800, SERIAL_8N1, 16, 17); // Initialize Serial2 with a lower baud rate Serial.println("Serial2 test started"); } void loop() { if (Serial2.available()) { String incoming = Serial2.readStringUntil('\n'); Serial.print("Received from Pi: "); Serial.println(incoming); // Send a response back to the Raspberry Pi Serial2.print("Hello from ESP32\n"); } delay(1000); } and this python script running the on the Raspberry Pi: import serial import time # Configure the serial port ser = serial.Serial( port='/dev/serial0', # Use the correct serial port for your setup baudrate=4800, # Lower baud rate timeout=1 ) def main(): time.sleep(2) # Give some time for the connection to establish print("Starting Serial communication with ESP32") while True: # Send a message to the ESP32 ser.write(b'Hello from Raspberry Pi\n') print("Sent: Hello from Raspberry Pi") # Wait for a response from the ESP32 response = ser.readline().decode('utf-8').strip() if response: print(f"Received: {response}") else: print("No response received") time.sleep(1) # Delay before the next message if __name__ == "__main__": main() This test worked as expected to communicate using the Tx and Rx pins on the Pi and Esp32. I'm just having trouble tracking down where in the OpenCatESP32 code I need to adjust things to get commands working with this port.
0
0
BiBoard Serial Port
In Hardware
Reid Graves
Jun 02, 2024
Yes, the switch is set to UART2
0
BiBoard Hardware Malfunction?
In Clinic
Reid Graves
May 11, 2024
This is what it does:
0
BiBoard sdkconfig.h
In Basic Assembly and Setup
[Forward] Bittle is an acorn pickup.
In Challenge
Reid Graves
May 09, 2024
Thanks Alex!
0
Bittle Stability on Rough Surfaces
In General Discussions
Bittle Stability on Rough Surfaces
In General Discussions
Bittle Stability on Rough Surfaces
In General Discussions
Bittle Stability on Rough Surfaces
In General Discussions
Bittle Stability on Rough Surfaces
In General Discussions
ros melodic raspberry Pi 02W bittle robot, serial communication.
In Clinic
Reid Graves
Mar 03, 2024
I'm so glad others are using it!
2

Reid Graves

More actions
bottom of page