ATmega32U4 code:

#include <Mailbox.h>
int i = 0;
void setup() {
  Bridge.begin();    // Initialize Bridge and Mailbox
  Mailbox.begin();
  Serial.begin(9600);    // Initialize Serial
  while (!Serial); // Wait until a Serial Monitor is connected.
}
void loop() {
  Serial.println(i);
  Mailbox.writeMessage(String(i));
  i++;
  delay(2000); // wait 2 seconds
}

AR9331 code:

nano mailbox.py
import socket
import json
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.1', 5700))
result = json.loads(s.recv(1024))
print result
s.close()
python -u mailbox.py
{u'request': u'raw', u'data': u'19'}

Comments (0)

    Attach images by dragging & dropping or by selecting them.
    The maximum file size for uploads is MB. Only files are allowed.
     
    The maximum number of 3 allowed files to upload has been reached. If you want to upload more files you have to delete one of the existing uploaded files first.
    The maximum number of 3 allowed files to upload has been reached. If you want to upload more files you have to delete one of the existing uploaded files first.
    Posting as

    Comments powered by CComment