Usb serial adapter and groovepi

I am using a USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi
to power and remote control pi by serial console ($ screen /dev/ttyUSB0 115200), since I enhanced my raspberrypi build with grovepi software stack the console is not showing up anymore (no output at all) :frowning: ā€¦ at least rpi is still powering up :wink:

Wonder if there is a way to fix for this issue.

dogi, you need to re-enable the serial console I think. We havenā€™t used this particular part, but I think it uses ttl over the pins our firmware reserves for serial communication with the GrovePi.

Hereā€™s an article about setting up TTL:
http://elinux.org/RPi_Serial_Connection

Are you saying that the RPIā€™s serial TX/RX pins are being consumed by the GrovePi? It was my understanding looking at your documentation that youā€™re only consuming the I2C interface (and SPI for Ardunio firmware update) to communicate between the RPI and the GrovePi.

Iā€™ve restored my cmdline.txt setting yet when it gets to the point of prompting for user login, it hangs.

Another data point is that when I now remove the GrovePi board, Iā€™m still unable to use my debug serial port connection. Looks like /dev/ttyUSB0 is populating but it is not recognizing keyboard input.

Give a man a fishā€¦

Was able to get my serial debug tty working again. Looked through the install.sh script and saw that it was effectively disabled in the /etc/inittab file. So after repairing these two conditions, I was able to boot up and communicate via the debug serial connection with and without the GrovePi attached:

echo " - in /etc/inittab comments out lines containing AMA0"
echo " - in /boot/cmdline.txt removes: console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1"

I added some comments to the install.sh to make it a bit more clear what is going on. Looks like it may have helped :slight_smile:

Appreciate it.

Obviously the debug serial was disabled for a purpose so what might that be? In other words what am I going to run up against if I continue to run my system this way?

Also, is there a published API for the I2C interface with the GrovePi Arduino firmware?

Not sure. Perhaps Karan might be able to shed more light.

I am not really sure what you mean about the API for I2C.

The GrovePi board is basically a custom Arduino (Atmega328p) which exposes digital + analog pins as Grove 4 pin sockets, draws power from the GPIO and is reprogrammable over SPI. The I2C ports are pass-through. Scripts running on the pi can interact with I2C sensors directly as well as predefined commands in the GrovePi firmware, which makes it act sort of like a proxy for the sibling I2C sensors. You issue commands to the GrovePi over the I2C bus and it returns readings from itā€™s digital, analog, serial or uart ports, or it relays I2C commands to adjacent sensors and returns their response.

If you want to issue your own hand crafted commands to the GrovePi, you basically need to write i2c blocks in the format [GrovePi-i2c-address,command,pin,value1,value2]

The GrovePi listens on the wire for 4 ints then tries to execute the command on the specified pin (and adjacent pin if the sensor uses all 4x wires: DATA,CLOCK,VCC,GND or TX,RX,VCC,GND etc). Some commands use a single value, some use both values, some donā€™t need any values.

Some of the commands return values - youā€™ll receive ints back down the wire. Some commands return more ints than others.

The GrovePi Arduino firmware:

More about the GrovePi protocol:
http://www.dexterindustries.com/GrovePi/engineering/grovepi-protocol-adding-custom-sensors/

Thanks again mcauser.

By API I was meaning the actual data structure to be passed across I2C interface to perform specific operations (e.g., digital read, analog write, etc.). While waiting for a response, I found the version 1.1 sketch being run in the 328p and can see the command breakout. In general, the sketch is actually quite simple. The bit about the I2C ports being passthru is a good tidbit. Iā€™ve yet to dink with I2C so that is good to know.

Also, looking at the port layout I see a port labeled RPISER with a description as a passthru from the RPI. So I would interpret that as being the reason the tty was taken out of the loop with the intent being that the RPI can directly control a serial interface sensor via TX/RX on the GPIO.

Hi guys,
Sorry for the confusion with the usage of the Serial debug menu being disabled by default.

The reason that was done is because that the ā€œRPISERā€ port is connected directly to the Raspberry Pi Serial pins, so that you can attach complex Serial Sensors like the Grove GPS and directly read and write values from the Raspberry Pi.

The GrovePi itself does not use Serial in any way and relies on I2C for communicating with the Raspberry Pi. So if you wonā€™t be using Serial sensors, then you can enable the debug on Serial port without any conflicts.

Thanks,
Karan

thanks :slight_smile:
to make it work I modified the install script this way:

git clone https://github.com/DexterInd/GrovePi.git
cd GrovePi/Script/
chmod +x install.sh
touch /boot/cmdline.txt.bak
touch /etc/inittab.bak

./install.sh