So I’ve got the RPi camera images sending to my laptop now, after installing OpenCV4, and running the test code from https://github.com/jeffbass/imagezmq
from board import SCL, SDA
import busio
from adafruit_pca9685 import PCA9685
from adafruit_motor import servo
i2c = busio.I2C(SCL, SDA)
pca = PCA9685(i2c)
pca.frequency = 50
servo2 = servo.Servo(pca.channels[2])
for i in range(90):
servo2.angle = i
for i in range(90):
servo2.angle = 90 - i
pca.deinit()
i changed it to 90 degrees and got rid of the comments. It suggests a min and max for the servo.
I ran it and the servo got angry with me and wouldn’t stop. I had to unplug everything because it was eating up the cables in its madness.
It keeps going if I plug just the power back in. It seems to rotate continuously. So something is f***ed. Rebooting RPi. It’s supposed to be 180 degree rotation. Will need to read up on servo GPIO forums.
Starting Nmap 7.60 ( https://nmap.org ) at 2020-04-05 17:06 UTC Nmap scan report for _gateway (192.168.101.1) Host is up (0.0026s latency). MAC Address: B8:69:F4:1B:D5:0F (Unknown) Nmap scan report for 192.168.101.43 Host is up (0.042s latency). MAC Address: 28:0D:FC:76:BB:3E (Sony Interactive Entertainment) Nmap scan report for 192.168.101.100 Host is up (0.049s latency). MAC Address: 18:F0:E4:E9:AF:E3 (Unknown) Nmap scan report for 192.168.101.101 Host is up (0.015s latency). MAC Address: DC:85:DE:22:AC:5D (AzureWave Technology) Nmap scan report for 192.168.101.103 Host is up (-0.057s latency). MAC Address: 74:C1:4F:31:47:61 (Unknown) Nmap scan report for 192.168.101.105 Host is up (-0.097s latency). MAC Address: B8:27:EB:03:24:B0 (Raspberry Pi Foundation) Nmap scan report for 192.168.101.111 Host is up (-0.087s latency). MAC Address: 00:24:D7:87:78:EC (Intel Corporate) Nmap scan report for 192.168.101.121 Host is up (-0.068s latency). MAC Address: AC:E0:10:C0:84:26 (Liteon Technology) Nmap scan report for 192.168.101.130 Host is up (-0.097s latency). MAC Address: 80:5E:C0:52:7A:27 (Yealink(xiamen) Network Technology) Nmap scan report for 192.168.101.247 Host is up (0.15s latency). MAC Address: DC:4F:22:FB:0B:27 (Unknown) Nmap scan report for chrx (192.168.101.127) Host is up. Nmap done: 256 IP addresses (11 hosts up) scanned in 2.45 seconds
if nmap is not installed,
apt-get install nmap
Connect to whatever IP it is
ssh -vvvv pi@192.168.101.105
Are you sure you want to continue connecting (yes/no)? yes
And I’ll unplug the ethernet and try connect by ssh again
Ah, but it’s moved up to 192.168.1.106 now
nmap -sP 192.168.101.0/24 (I checked again) and now it was ‘Unknown’, but ssh pi@192.168.101.106 worked
(If you can connect to your router, eg. 192.168.0.1 for most D-Link routers, you can go to something like Status -> Wireless, to see connected devices too, and skip the nmap stuff.)
I log in, then to configure some stuff:
sudo raspi-config
Under the interfaces peripheral section, Enable the camera and I2C
worked for setting up wireless access on the sd card.
“Since May 2016, Raspbian has been able to copy wifi details from /boot/wpa_supplicant.conf into /etc/wpa_supplicant/wpa_supplicant.conf to automatically configure wireless network access”
In essence, the default pi user no longer exists, so you have to create it and set its password using either the official Imager tool or by creating a userconf file in the boot partition of your microSD card, which should contain a single line of text: username:hashed-password
I started up a raspberry pi with raspbian installed on it. (I used balena’s etcher to flash an sd card): the light version, basically just Debian OS for rpi: https://www.raspberrypi.org/downloads/raspbian/
Ok but how do we power servos? We can’t run it off the RPi’s 5V 2A. Oh duh, there’s that big DC socket connected to the PCA9685
There is something to be said for running the robot on an Arduino. You get something robotic. You upload someone’s hexapod spider code, and it does a little dance. You can control it remotely. It can interact with sensors.
Arduinos are dirt cheap. So I bet we could have tiny neural networks running in arduinos… shit, do we already have them? Let’s see… ok wow there is like a whole thing. https://blog.arduino.cc/2019/10/15/get-started-with-machine-learning-on-arduino/ ok but 2K of RAM is not much. You would need to be a real demo scene junky to use a 2KB NN, but yeah, you could do something crudely intelligent with it.
Robots on ESP32s are definitely a thing. But ok no, Raspberry Pi for real robot. We need Linux for this.
Ok so I need to wire this up. But I also need a chassis for the robot.