[google-aiy]: Two vision bonnets on RPi - raspberry-pi

This is related to project that I'd like build using Google AIY VIsion Kit + Raspberry Pi.
I'd like to attach two vision bonnets to RPi zero W. I realized that Pi interacts with Vision Bonnet using SPI interface. From the schematics of RPi GPIO header, there seems to be two SPI interfaces as well. So, I'm wondering if I can connect two vision bonnets to the Pi. Would that be possible?
Furthermore, I've got two ideas in this regard:
(1) I think all the 40 pins won't be used by a single Vision Bonnet. So, if I know what pins are actually used, I can use that information to consider adding another Vision Bonnet. However, I'm not sure how to get this information though. Can you help me with this information?
(2) If I can't get the detail in (1), I'm thinking to extend the GPIO header on Pi by adding one more header on the VisionBonnet. Then, I'll attach the second bonnet to the newly added header. Does this make sense?
Thanks,
Venky

I posted the question in Google AIY Vision kit issue and the Google developers said that it's not possible.
https://github.com/google/aiyprojects-raspbian/issues/348

Based on the modules loaded (run lsmod), and the python code. I believe it uses more than one SPI. Given this, the answer is that very likely it won't work.
1/ I was not able to find a schema of the bonnet.
2/ Adding headers and connecting the second bonnet won't work as SPI supports communication of two peers only. SPI of the second bonnet will have to be connected to SPI2.
More information, that I found later:
The vision bonnet uses the following GPIO:
SPI interface: GPIO10, GPIO09, GPIO11, GPIO08
Handshaking: GPIO06, GPIO13
An SAMD09 MCU is hung off the I2C bus and uses address 0x51, 0x61 (bootloader only)
LED driver uses address 0x30

Not quite what you are after but I managed to get the Movidius NCS to run on the Pi. It has the same accelerator as the VPU bonnet (Intel® Movidius™ Myriad™ 2 vision processing unit (VPU)). They cost more but you can put as more than one NCS on a Pi via the USB interface. I assume you want to run two models simultaneously rather than scale one model.

The 40-pin pinout as described on google/aiyprojects-raspbian and Vision Bonnet :
3.3V --> 1 2 <-- 5V
I2C_SDA --> 3 4 <-- 5V
I2C_SCL --> 5 6 <-- GND
7 8
GND --> 9 10
11 12
13 14 <-- GND
(GPIO_22) BUZZER_GPIO-->15 16 <-- BUTTON_GPIO (GPIO_23)
3.3V --> 17 18
SPI_MOSI --> 19 20 <-- GND
SPI_MISO --> 21 22
SPI_SCLK --> 23 24 <-- SPI_CE_MRD
GND --> 25 26
ID_SDA --> 27 28 <-- ID_SCL
29 30 <-- GND
PI_TO_MRD_IRQ --> 31 32
MRD_TO_PI_IRQ --> 33 34 <-- GND
35 36
MRD_UNUSED --> 37 38
GND --> 39 40

Related

raspberry pi gpio or rs232 relay board for simultaneous output bit-map?

I really wanted at first an rs232 8-channel relay board that I could command devices to turn on/off with a command string.
All of the ones I found online have the same deficiency in functionality for me: you can't set a subset of relays at the exact time. I can set relay 1 on, and then relay 7 on afterwards, I can set all 8 relays at once, but there is no command structure to pick out the exact leds I would like to turn on/off.
In the past I have dealt with hardware that had a bit-map of the IO pins, and a bit-map of the states and would apply all 8 settings at once. here are some examples:
to set pins 1 and 7 to on and the other pins off (8-bit binary bit-mapping,) send the following byte: in binary: 0100 0001b
to set pins 1,2,3,6 to on and the other pins off (8-bit binary bit-mapping,) send the following byte: in binary: 0010 0111b
I couldn't find any such device to do this so I thought I could make one with a raspberry pi using a simple 8-channel relay board, something like this:
https://www.amazon.com/SainSmart-101-70-102-8-Channel-Relay-Module/dp/B0057OC5WK
but on a Raspberry Pi, I'm running into the same issue: I don't see a way to set the gpio pins as a block command, only individually setting them in a for loop. I looked all morning and can see things like gpioctl, and mmio, but I can't put it all together to a simple proof of concept program on a testboard, any help would be appreciated.
I would really like a solution in C or scripting,
Thanks,
jleslie

How many GPIOs does Raspberry Pi A+ really have?

Could someone clarify for me why official documentation of RPI A+ says that it has 40 GPIOs while other sources, such as forums, online courses, and others say that it has 54 GPIOs? What is each one talking about? Is there a difference in types of GPIOs that each source is referring to?
RPI Tutorial by University of Cambridge
https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/ok01.html :
"There are 54 GPIO pins, so we need 6 sets of 4 bytes, which is 24 bytes in total."
Adafruit Website RPI specs
https://www.adafruit.com/product/2266 : "It's still compatible with all Pi operating systems and software, and has the exact same 40 pin GPIO connector and camera/display sockets"
BCM2835/BCM2835 micro-processor have 54 general-purpose I/O (GPIO) lines in total. This what RPI Tutorial by University of Cambridge is claiming but out of these 54 GPIO lines only 28 general-purpose I/O (GPIO) come on the external J8 header which can easily be interfaced with outside world. 12 pin are used as power pins +3.3V (2), +5V (2) and GND (8).

Imitate S7 SIemens PLC

I am trying to imitate a SIEMENS S7 PLC so that scanners like Nmap, Zgrab and NESSUS will detect my Raspberry as an PLC. When looking at the NSE script voor Nmap (based on lua) itś clear that the response can be decoded with the following structure:
DATA DATA TYPE Location in response
Protocol ID C 8
SZL-ID C 31
Module information z 44
Basic Hardware z 72
Version Number CCC 123
Plant ID z 108 + offset
Copyright z 142 + offset
Serial Number z 176 + offset
System name z 40 + offset
Module Type z 74 + offset
Where: z is a zero-terminated string
C is an unsgined char
offset = 4
The connection to the PLC is established via socket connection. Now I am looking for a way to recreate this package and respond accordingly.
Have a look at the Snap7.
Somehow this library does what you need. It acts as S7-PLC, and responds even to Simatic Manager.
As Freeman suggests, install windows iot core on your raspberry and use Snap7 to emulate your S7 PLC on raspberry. You will also be able to control remote IO stations with your 'Soft PLC'.

Raspberry CM3 + additional sd card

I want to use Raspberry Compute Module 3 (CM3) for an industrial project.
The problem is that 4GB of emmc (connected to SD0 broadcom private bus) is not enough.
I want to connect an additional SD card (8GB) throught the second SD interface SD1 (GPIO from 22 to 27 in ALT3).
The problem is that with this connection and with the default Raspbian Lite jessy (kernel 4.4) the connected sdcard is not recognized.
I tried to set the gpio alternate (ALT3) function with cli raspi-gpio but no results.
What is the problem?
We are using the CM3L version (no on-board flash), and my references are to the schematic titled "Raspberry Pi Compute Module 3 (reduced)", dated 10-13-2016.
The CM3L cannot access an external SD card because the control lines are not brought out to the card-edge pins. We modified our CM3 samples, turning them into CM3L units with the following steps to remove the on-board flash and to bring the control lines to the card-edge pins (notes taken from my marked-up schematic):
To turn CM3 into CM3L:
Move R24 to R25 position
Short R12, R16, R17, R18, R19
Remove U7 (BGA Flash)
Not documented, but seems to be necessary: R9 should be zero Ohms,
and R8 is listed as a 2.2k Pull-up, but seems to be zero Ohms. Move R8 to
R9 position (or maybe just short across R9 pads.
Posssible using other gpio but not sd0, eg. Dev board won't do without modification.
See this thread. The other answer isn't ideal IMHO as you can't use both and are permanently modifying your compute.
You can have the 2nd SDIO peripheral at GPIO 22-27 or 34-39.
https://www.raspberrypi.org/forums/viewtopic.php?t=172406

Raspberry B+ Power Supply calculation

I'm new to Raspberry Pi and I don't understand about electricity. I bought a Raspberry B+ today and a 5V 3A power supply, but I'm afraid to connect it because in several places I read about using 5V 2A power supplies. I believe that only higher voltages can damage the Pi but, since I don't know about Amp, I don't know if this is true for 3A too.
My ideia is create a mini-personal server in my home, running Pidora. For data, I have a 1 Tb external USB drive with no external power supply (Seagate model SRD00F1).
My questions are:
can I use the 5V 3A power supply on Raspberry Pi B+ without damage it?
this power supply is compatible with my external USB drive to keep it on safely?
Thank you!
The Raspberry Pi FAQ says that the B+ uses between 0.7 and 1.0 amps, and suggest a 1.2 amp power supply as a minimum.
Using a power supply with a higher amperage rating will not harm your Raspberry Pi. Devices only draw as much current (amperage) as they need. Any additional capacity is unused.
This is where your question about the external hard drive comes in. If you see in the FAQ, they suggest that you might want a larger power supply if you use all of the USB ports. Every USB device you plug in is going to draw more current. To figure out how much you need, you just add up the requirements of all of the devices like so:
Raspberry Pi = 0.7-1.0A
Mouse/Keyboard = 0.5A
Hard Drive = 1.0A
========================
TOTAL = 2.5A
(These numbers are all fake... be sure to check the requirements for your actual devices.)
So if your devices total 2.5A then a 3A supply will handle all of these plus some room for expansion. If all of your devices total 3.5A, maybe you need to consider a bigger one.