-
-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
I'm trying to send a packet from Python to the Arduino but the handler is never triggered. Maybe I misunderstand the packet format?
I'm using the COBS library to encode the data. Here's the packet as it is sent using the standard python serial library:
b'\x03\x01\x04\x00'
Here's the Arduino code:
#include <PacketSerial.h>
PacketSerial myPacketSerial;
void setup() {
myPacketSerial.begin(9600);
myPacketSerial.setPacketHandler(&onPacketReceived);
}
void loop() {
myPacketSerial.update();
}
void onPacketReceived(const uint8_t* buffer, size_t size)
{
uint8_t tempBuffer[size];
memcpy(tempBuffer, buffer, size);
uint8_t id = tempBuffer[0];
myPacketSerial.send(id, 1);
}
Why am I not getting anything back?
Metadata
Metadata
Assignees
Labels
No labels