Searching these forums can be pretty difficult sometimes...
I just found this - How to send data from Linux to Edison using serial communication?
Which links to - Using Serialx on Edison
Trying to see if this solves my problem...I just thought you could use the console AND serial output thru another UART...
Looks like we can close this topic, but I plan to continue looking into it....
Steps to get Edison<-> ESP communicating...
HW: I have Edison (latest firmware EDISON-3.5 / 201606081705) + Sparkfun Base Block + Sparkfun 9DOF (LSM9DS0) Block
* both USB cables hooked up to PC from the Base Block
1) Reference post Re: How to send data from Linux to Edison using serial communication? to disable serial-getty service on the usual COM port that you get Edison shell access to:
1. Connect the Edison through SSH and COM in 2 Putty sessions
2. Disable the serial terminal in the COM session typing these commands in the SSH session:
systemctl stop serial-getty@ttyMFD2.service
dmesg -n 1
- As the post suggests, you can use Arduino IDE in this setup to use the Serial2 library from here out. I didn't do that because I haven't setup this sensor in Arduino. I probably will look back later. Until then, I can write up a MRAA program that will take it from here...keep reading...
2) You still have two sessions open, the COM one will not show or except any more input from your PC - it will just show you the traffic on Edison's /dev/ttyMFD2 port. You can verify this by sending an 'echo' command from your SSH session like (programming - how to write characters to serial port - Ask Ubuntu )
echo -e "HELLO" > /dev/ttyMFD2 // observe the string was written to the COM port
echo -e "10\t50\t100" > /dev/ttyMFD2 // example string that ESP expects, you can use this to fool it to test
3) Close your COM session to free up /dev/ttyMFD2. Launch ESP on your PC and under the Configuration menu, select the same COM port you were just using.
- ESP will start listening right after selecting the COM port. You can see if it's working by sending the example string a few times that I put in step #2
4) Wrote a little MRAA C program with the LSM9DS0 to open up /dev/ttyMFD2 and initialize the accelerometer. Reading the accelerometer every 10ms, it will write the readings in the "<x>\t<y>\t<z>" string format to /dev/ttyMFD2. It shouldn't matter if ESP is running or not once the output starts coming from your program/Edison.
https://github.com/jimmery/Tilted (only trace of C library LSM9DS0 I found on the internet)
5) ESP can now be calibrated and trained with data from the 9DOF block/LSM9DS0. It will send gesture predictions to localhost TCP port 5204 in the format "<gesture#>\n".
- if this address:port combo is not good for you, you can actually get more control if you use the ESP libraries to create your own Arduino IDE or Processing ESP mode sketches. (GitHub - damellis/processing-esp-mode: A simple editor for ESP code that runs inside the PDE )
- Using the user_accelerometer_gestures_simple.cpp sketch in Processing, I can change the localhost to be my Edison IP. Using the socat command, I can do a quick listen on port 5204 (socat tcp4-listen:5204 -). Processing will launch its own instance of ESP, if you reload your calibration and training data or reset it all up, you can test it's predictions and see if it sends the gesture # back to your Edison. Ideally this port listen will be merged into the little C program that's sending the serial accelerometer data to ESP - just haven't gotten there yet.