Closed flycast closed 6 years ago
Can you clarify what you are trying to accomplish with the YunBridgeLibrary? YBL will conflict with the SDK's usage of the serial port.
Yes. Get the date since Linux epoch in seconds, seconds + milliseconds if possible. I need a time stamp.
Ah yes, this will be tricky. The IoT SDK takes control of the serial link and expects that it is in the default reset state. By using YBL, the serial link is no longer in the default power-on state. Unfortunately, this is one of the reasons I mentioned in your last ticket (#58) that you'll want to use the Python IoT SDK directly on the AR9331 and write your own arbiter for the inter-processor serial link. You'll likely need to write some custom code to multiplex the SDK traffic and your Linux commands over the serial link.
If you only need the time-stamp once at program start, you could maybe do something like this:
void setup() {
Bridge.begin();
Bridge.whatever();
Bridge.end();
Serial.begin(250000);
while(!Serial);
//
char curr_version[80];
snprintf_P(curr_version, 80, PSTR("AWS IoT SDK Version(dev) %d.%d.%d-%s\n"), VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG);
Serial.println(curr_version);
}
That said, I don't know if it will work. You may still need to kick the serial port into a clean state which can be used by the SDK.
As yes, this will be tricky. The IoT SDK takes control of the serial link and expects that it is in the default reset state. By using YBL, the serial link is no longer in the default power-on state. Unfortunately, this is one of the reasons I mentioned in your last ticket (#58) that you'll want to use the Python IoT SDK directly on the AR9331 and write your own arbiter for the inter-processor serial link. You'll likely need to write some custom code to multiplex the SDK traffic and your Linux commands over the serial link.
Sounds WAY over my head!
There is no Bridge.end();
Closing due to inactivity. Please feel free to start a new thread/issue if you have any additional questions.
Just to explain a bit more. Here at Arduino we implemented the mentioned Bridge.end(); as suggested by @hedeshianaws It is now merged on master and available to everyone at https://github.com/arduino-libraries/Bridge
If I use the following code I can connect every time:
Once I use Bridge.begin(); in my setup():
I start getting
This behavior persists until I run YunSerialTerminal and issue the ~~ command.
What may be happening here?