@crispyoz Thank you for your clarification. When the Relay expansion was discontinued I presumed that I would have to use the Arduino dock to drive a relay. I was using the Arduino's pin 10 in my experiment. Your clarification prompted me to consider that I could drive the relay directly from the Omega.
I chose pin 18 because it appears from the docs that it's a straight digital and doesn't appear to be multiplexed. It reads as input which s/b safe and the relay is now getting its voltage from the 3.3v pin.
The php script works as expected. In reading the linked doc, I don't suppose I can get this pin to stay off on omega reboot (after power failure). The relay is set to normally open.
Thank you again for your clarification, sam
sam walton
@sam walton
Best posts made by sam walton
Latest posts made by sam walton
-
RE: micro-python cgi to arduino dock
-
RE: micro-python cgi to arduino dock
@crispyoz Thank you for replying. I agree I can install php7 but little else.
Forgoing git and its libraries I've followed the link above and downloaded the Omega.php from this gist.
As the post states, it's a wrapper around the fast-gpio command.Following its example running
fast-gpio set 10 1 2>&1
returns Set GPIO10: 1
But my relay on pin 10 yields no change. I believe it's working because I wirelessly uploaded a simple Arduino script that cycles pin 10 on and off successfully. Could it be the fast that I'm running an Arduino expansion board for Omega that's letting the fast-gpio command on the Omega fail silently?
Is there another Omega library I need to drive Omega's GPIO?
Thx for viewing, sam -
micro-python cgi to arduino dock
Back on my project to set my Onion 2 to use its uhttpd server to listen for commands to trip an attached relay to open/close my garage door. With the elimination of the Relay Expansion it's not clear how to tie this. Searching I found an old doc to load up php5 and its php5-cgi that should be the bridge.
The problem is that php7 (and likely php5 if I could find it) suck up all available space and thus unable to load any library that can talk to Omega's GPIO.
On paper micro python ought to be small enough to allow other software. While there is a micropython-cgi library, the pip (or upip) module didn't come with this package. I've installed the micropython-libmicropython -v MicroPython v1.9.2 on 2021-01-07; linux version
If I can get (u)pip installed and then micropython-cgi is there a library to tie the cgi to the Onion's GPIO? Are there examples of micropython communicating with its GPIO? thx, sam
-
RE: Leanest python
@Lazar-Demin
It would appear that my original Omega does not have access to these libraries. I swapped it out with a newer Omega2 which appears to have the same storage space. Doing a factory reset on it, using the Arduino Dock 2, I find that python-urllib3 is available.opkg update
opgk install python-urllib3
is found and helpfully attempts to install python-light as well.
Unfortunately, it fails due to the same problem that python-light and perhaps the urllib3 is too much for the Omega2.
Is that true? Would installing PHP instead of Python fit on an Omega2 ? -
RE: Leanest python
@Lazar-Demin
Thank you for replying. To be certain I am not missing out on any libraries, I've uncommented all lines using
vi /etc/opkg/distfeeds.conf
opkg update
opkg list | grep urllib
returns no results. Certainly not when I attempt to install python-urllib3.
Again, this is after a factory reset of this Omega. Checking for any firmware upgrade returns
"no upgrade required" for this 0.1.4 (b330).
So something is preventing me from seeing this python-urllib3 to let opkg install. -
RE: Leanest python
@Stanton Thank you. Running
opkg update opkg list | grep lean
returns a list of libraries that have the word "lean" in them. The only thing I see with python is micropython.
Is there an actual library called python-lean ? If so, it does not appear to be available to me? -
Leanest python
I have an original Omega from the kickstarter, and an Omega 2, so already we know that space is at a premium.
Of course, I can
opkg install python-light
and that works. The trouble is that I can never finish installing
opkg install python-pip
without it running out of space. It would appear that I'm installing a lot of modules. I really only want the time and requests module. The output shows downloads of codecs, installs and configuring. Then the errors roll in.Perhaps I can remove these codecs?
I factory reset the Omega and attempting to get what I need from installing micropython and its micropython-lib. While that lib would seem to have included urequests, following the comments in the module it would appear that micropython is unable to find what it downloaded.
Of course, this shows that I don't know how to manage python and is why I'm asking how to get a lean python on the limited storage of the Omega without throwing away in favor of the 2+? How would you get requests working on it? I'm avoiding ESP32 because I've found the Omega's wifi far more reliable, sam
-
RE: Set up access to two wireless networks
Yes, thank you for the prompt response. The info was contained in the link you provided at the end. Perhaps others will find this in their searches more quickly than I, sam
-
Set up access to two wireless networks
Searched but could not find how this is done. Finally got my Omega 2 to find my wireless network. Now if I want to move it to another network, is it a simple duplication of the
config wifi-iface
config wifi-configA pointer to where this info is would be appreciated, thx, sam