Usb serial adapter and groovepi


#1

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.


#2

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


#3

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.


#4

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.


#5

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"


#6

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:


#7

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?


#8

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/


#9

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.


#10

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


#11

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