
j98221
USA
Asked
— Edited
hi
i just purchased the pan tilt hat. i know it works because i tried the python examples.
But how can i get ARC to recognize it?
I do have the ez server installed on the rpi with a camera, it connects, i tried the camera control example and the video works. i added the vertical servo, tried to set it up as D0, D1 and D2. neither will control the pan and tilt hat. i believe the pan and tilt works of of i2C but i am not certain.
information on the pan and tilt hat can be found at http://pimoroni.com/pantilthat
please help, Thank you in advance.
Related Hardware Raspberry Pi
Hello @j98221,
Unfortunately, you are correct, the pan and tilt hat communicates via I2C (found the pinout here). If you are able to setup those pins as regular GPIO maybe it could work with ARC. Otherwise, you may have to write an EZ-Script with I2C commands to make it work. Writing your own I2C commands is tricky business, but not impossible.
can i execute a python script from EZ-Script?
It's theoretically possible. If you have a python script running on the Pi and it's waiting for a signal from ARC (like a high signal on GPIO7 for example) you could likely make it work. I don't have a code example for you but others here in the Synthiam community might be able to help.
i will look into executing a python script with parameters from ez-script. if anyone can help i would very much appreciate it.
@J98221,
I have a python solution compatible with ARC, I'll post more details later.
What model of Raspberry PI and Linux distro do you have ?
i have model 3 b+ running the latest distro which is buster.
thanks
@j98221: clone the repository on your raspberry pi home folder:
edit the file to match your hat controller:
uncomment the line 158 (setup_i2c_PimoroniPanTiltHatServoController):
start the server (EZB and Camera Server):
Then use the ARC connect to the Server (you can use the Antenna to discover the address and port) add two servo controls D0 and D1 and test the movements.
PS: Due to limited time the instructions are minimal. I'll provide more details later.
after editing line 158 and saving the file, started EZB, then i started another terminal session and started cd ~/BlueberryServer/Blueberry.Server.Python/ python3 Main.py. i received the following error;
pi@saripi:~ $ cd ~/BlueberryServer/Blueberry.Server.Python/ pi@saripi:~/BlueberryServer/Blueberry.Server.Python $ sudo python3 Main.py & [1] 1314 pi@saripi:~/BlueberryServer/Blueberry.Server.Python $ 1319-root-INFO-Starting... platform=linux hostname=saripi Traceback (most recent call last): File "Main.py", line 178, in main() File "Main.py", line 139, in main setup_PyAudioPlayerController() File "Main.py", line 129, in setup_PyAudioPlayerController import PyAudioPlayerController File "/home/pi/BlueberryServer/Blueberry.Server.Python/PyAudioPlayerController.py", line 7, in import pyaudio ModuleNotFoundError: No module named 'pyaudio'