ChipChop Support Forum
Log in
Log out
Join the forum
My Details
REPLIES: 9
VIEWS: 256
BACK
REPLY TO THIS POST
Jac0b0
14 Sep 2023
Chipchop on PI zero?
Hi there, quick question, I've got a bunch of PI Zero returned by a client from a finished project so I was thinking I could put them to good use and have them run some automation in my workshop
I could use esp32 but I have these with everything setup and working (linux, wifi etc) so if I attach some relays, motion sensor, lights is there a way to connect them to my chipchop dev console?
lampix
14 Sep 2023

You could rewrite the chipchop library in python if you know how
bartsimpson
15 Sep 2023

check with Gizmo, I know he has some other non Arduino libraries.
Joe Bazzoo
16 Sep 2023

I've found this
https://github.com/me-no-dev/RasPiArduino

/////////////////////////////
Features

-The familiar Arduino API
-pinMode/digitalRead/digitalWrite/analogWrite
-Full SPI, Wire and Serial compatibility
-Access to STDIN/STDOUT through the Console class
-Access to system tty through the TTY library
-Process, FileIO, Client, Server and UDP implementations through the Bridge library

//////////////////

lampix
16 Sep 2023

@joe

That looks very old and hasn't been updated in what 5 years,? sounds good on paper though, has anyone tried it?
Gizmo
16 Sep 2023

I have a half completed library for Node.js, I have run it on a PI Zero W2 (not sure about just Zero W) but I need a bit of time to finish it before I can release it into the wild.

If you want to try the current version we will have to have a remote session (zoom/teams) so I can show you how it works and where it can be tweaked.

Node works great and you shouldn't have any problems using it on a PI with the serial port library for sensor/device control but for the Pi Zero you will be limited to an older version of Node. I think from memory the highest version available for Arm6 is I think Node 11? (older Pi Zero is Arm6, right?)

Effectively it's getting the PI to run as a Node web server so you also need to setup something like Forever or PM2 in case it goes down and you can use Nginx as a reverse proxy which works great talking to the PI over mDNS (Bonjour) and a .local domain.

I need to dig out my notes on how I've set it all up, there are some limitations on some libraries that simply wont work in older Node and on a the Zero you can forget things like a desktop experience. Probably the easiest is to run Ubuntu on it.

Ping me an email if you want to go down this rabbit hole :-)
Jac0b0
16 Sep 2023

hey thnx Gizmo, Node would work, I'm ok with Javascript. These run Pi OS but I can easily get Ubuntu on them, for what I need it doesn't have to be too clever.
Yes, I know about forgetting the desktop on these, tried Chromium and it just choked and died ⚰️

I don't want to take too much of your time, if you send me the node lib I can see if I can find my way around
Gizmo
17 Sep 2023

Ah cool, no worries, I'll email you the library just stick it in a folder an "require" it as an instance




        let ChipChop = new require("./some-folder/chipchop_manager.js")



I've tried keeping the api same as in the Arduino library so you make the same calls, just look inside the code and you will see which methods are exposed through " this. "..."this.someMethod = ..."

If you get stuck just let me know.

I really need to find the time to complete this library and make it public :-(
istvan_g73
12 Dec 2023

Any news on the Node.js library when it will be public or can I try what's available like Jac0b0?
Gizmo
13 Dec 2023

Hi Istvan,

Still haven't found the time to polish it up but Jacobo didn't complain so he must have managed to use it.

I'll ping you a copy on your registered email and shout if you need any help