For connecting multiple relays consider ULN2803A - it's an array of 8 transistors in a $1 chip.
Posts made by Michal Rok
-
RE: Advice for using generic 5V relays
-
RE: Omega2+ on mikrotik ... nothing works
My post at https://community.onion.io/topic/1149/omega2-fails-to-connect-to-wifi/66 describes a solution I verified multiple times on Omega2's out of the box. I did not have to adjust my Mikrotiks at all. Try it yourself.
Michal
-
RE: Omega2+ fails to connect to wifi
Finally got my Omega2 to reliably work with Mikrotik wifi in WPA2PSK-AES mode!
Here's the trick: as discovered earlier by @Scott-Horsley the option mode 'sta' allows connecting to AP, but does not allow any useful transmission. I found out that if you switch to mode '9' (original setting) following a successful connection in mode 'sta', without reboot, it will work!
Try this on a clean Omega:
- set your SSID, password and mode with the following commands:
uci set wireless.@wifi-iface[0].ApCliSsid='yourssid' uci set wireless.@wifi-iface[0].ApCliPassWord='yourpassword' uci set wireless.ra0.mode='sta' uci commit
- then edit /etc/rc.local to include: (before the "exit 0" line)
/sbin/uci set wireless.ra0.mode=9 /usr/bin/nr
Do not commit the mode=9, you need config file to remain set to mode='sta'. Reboot to try out.
Good luck!
ps. in an out-of-the-box Omega2, this will skip the installation wizard and you'll need to install the Console manually
-
RE: Omega2+ fails to connect to wifi
@Alex-Thow are you also experiencing an issue with firewall or do you have full connectivity?
-
RE: Omega2+ fails to connect to wifi
@Scott-Horsley can you please post results of /interface wireless export here? It will show just the non-default parameters and might make it easier to reproduce.
-
RE: Omega2+ fails to connect to wifi
@Scott-Horsley I was suspecting that some default firewall kicks in when Omega's software sees an open, unencrypted wifi network. But that assumes you're running an open network too, but I'm reading this wasn't the case.
I wasn't able to reproduce your observations regarding encryption - for me, Omega never connects to a WPA2PSK/AES network.
-
RE: Omega2+ fails to connect to wifi
@Scott-Horsley further observations:
- firewall is controlled by fw3 which in turn controls iptables
- flushing iptables (iptables -F) does not solve the problem
- a device connected to the Omega can connect to the Internet but DNS won't work (seems to be an issue with Omega's NAT config)
- if you instruct iptables to log outbound traffic (iptables -t filter -A OUTPUT -o apcli0 -j LOG), then dmesg actually shows those missing packets that don't arrive to the router
Seems like there is a second firewall layer after iptables are applied.
Michal
-
RE: Omega2+ fails to connect to wifi
@Scott-Horsley thanks! I wasn't able to reproduce your config - for me, the change from option mode '9' to 'sta' doesn't change a thing. I still get "wlan1: disconnected, unicast key exchange timeout" in router logs.
However, I made some observations that might help you move forward:
- with option mode 'sta' and security profile on Mikrotik set to default (open - no password), my Onion2 connects to wifi (!)
- I also observed only ICMP traffic passing through
- it seems to be a local firewall issue, as Mikrotik sniffing shows no outbound attempts
- you can disable Onion firewall by /etc/init.d/firewall stop, but it doesn't change a thing - the only traffic that the router receives is ICMP and ARP, but not TCP
Michal
-
RE: Power Consumption
Also very interested in this. My use case requires the device to wake up every 15 mins, collect data, upload and go to sleep again. All on budget and with space constraints.
M
-
RE: python3 startup time - ideas?
@Samuel-Mathieson no real reason to use py3 - I was learning Python so I thought I should start with the most recent version.
The time it takes to start bare shell in python2/3 is in my case:
- 4 seconds for Python 2.7
- 5.5 seconds for Python 3.4
But importing urllib.request increases the python3 startup time to 22 secs. For python2, importing urllib does not have that much impact (4->5.5).
Michal
-
RE: python3 startup time - ideas?
@Vinicius-Batista i was able to compile my code, but it wasn't any faster on startup
-
RE: python3 startup time - ideas?
Tried to compile with py_compile - didn't help.
According to "python3 -v" output, most of the time is spent reading system libraries. Take this simple file that does nothing:
import urllib.request
import urllib.parse
import jsonExecution takes literally 20 seconds on my Omega.
Michal
-
python3 startup time - ideas?
i've just written my 1st Omega app. When I press a button, my python3 code starts up, does some magic, and spells out today's weather forecast through a speaker.
My challenge is python's startup time - it literally takes 30 seconds for it to load the libraries I need and begin work. Do you have any tricks to make it quicker? I know I could have it run as a daemon, but while I'm working on the code I would need some tool to apply changes without restarting the daemon.
Michal