My CommonGround
Rsadeika
Posts: 3,837
In another thread I had made mention of this, so here I will expand. What I want to do is add access to a Raspberry Pi (RPi) to give the ActivityBot more processing power choices? I thought I would try two different setups, the first one will use a more direct serial approach. The RPi has a GPIO header that has a UART pin out, which will be connected to the p11 and p10 pins on the Activity Board with appropriate ground and power connections. The second method will be a straight forward connection using the USB cable from the Activity board to the USB socket on the RPi.
Below is some simple code that sort of works, but does not give me what I am expecting. In this setup the RPi starts up in a login procedure, and in my little program I was trying to create an automatic login with no success. It shows most of the RPi startup information, and it just rolls through the login and password to end up with a blank screen, I was expecting to see the RPi prompt at this point.
What I am trying to accomplish is having the SimpleIDE terminal screen act like a terminal program, basically auto login and then be able to type in commands to use the RPi. Then probably this would be a cog program in the ActivityBot program which would allow things like making use of the time() function that is already running on the RPi, just to name one item. You could use this cog to make use of all kinds of programs that the RPi has avaiable, in a background job situation.
Thanks
Ray
Below is some simple code that sort of works, but does not give me what I am expecting. In this setup the RPi starts up in a login procedure, and in my little program I was trying to create an automatic login with no success. It shows most of the RPi startup information, and it just rolls through the login and password to end up with a blank screen, I was expecting to see the RPi prompt at this point.
What I am trying to accomplish is having the SimpleIDE terminal screen act like a terminal program, basically auto login and then be able to type in commands to use the RPi. Then probably this would be a cog program in the ActivityBot program which would allow things like making use of the time() function that is already running on the RPi, just to name one item. You could use this cog to make use of all kinds of programs that the RPi has avaiable, in a background job situation.
Thanks
Ray
/* cg_test1.c */ #include "simpletools.h" #include "simpletext.h" #include "fdserial.h" serial *rpi; int main() { // Add startup code here. /* RPiTx RPiRx */ /* Rx Tx mode BAUD */ rpi = fdserial_open(11, 10, 0, 115200); char getBuff[80]; while(1) { // Add main loop code here. readStr(rpi,getBuff,80); if(strcmp(getBuff,"raspberrypi login:")) { writeLine(rpi,"pi"); } else if(strcmp(getBuff,"password:")) { writeLine(rpi,"raspberry"); } else { putLine(getBuff); } } }
Comments
http://linux.die.net/man/3/strcmp
Ray
Function getStr(char *buff, int max) should read serial data from the default Propeller serial port until max characters, CR (13), or NL (10) are detected.
For now I think I will shelf this project, and let the RPi go its separate way, while I work on a minimalist ActivityBot platform. Maybe I will rethink my idea of having some swarming ActivityBot activity, try to distribute the processing power over a couple of bots.
Ray