I am using this tutorial to connect an Arduino Yun with a browser using Autobahn.
In the python file in the above repo, there is this code:
def controlLed(self, turnOn):
if turnOn:
payload = b'1'
else:
payload = b'0'
self.transport.write(payload)
Here's the thing - I need to send whole sketches to my Yun, not just '1' or '0'. I tried sending more to the payload (like payload = b'this is part or all of a sketch'
) but that doesn't work. I experimented with some other data types but at the moment these are shots in the dark.
How can I send some proper data (like 100 lines of Arduino sketch) with this mechanism? The end goal is that my existing sketch receives the new sketch commands via serial and runs them.
if (port->available()) {
int commands = port->read();
// Run commands here
}
I would be hugely appreciative of any help. Thank you!