I have a simple question. I have one wall switch (toggle wall switch type) connected to digital input and 6 lights connected to 6 relays / relay outputs to UniPi. I would like the wall switch to toggle (turn on or off) 6 lights when it's pressed. The lights can not be connected to one single relay because I would like to control lights separately from web interface ('direct switch' not very useful).
What is the most optimal way to implement this scenario using evok (and python)? The most popular method is REST Api - however checking the digital input several times per second and switching on the lights when detecting changes on digital input (using GET requests) does not seem to be the optimal way... CPU consumption and temperature can be high. But what are the alternatives? Does using websockets from Evok Api cause a similar processor load as Rest Api and is this the best solution?
Is it possible to directly communicate with hardware and read a single digital input using for example i2c or spi? Is it possible to read this in the evok code and if so in which files? This is what bothers me in the recent days
Latest posts made by devmicha
-
Wall switch - with Evok
-
Disable evok.access.log
Hello all,
What is the safest way to disable writing logs into /var/log/evok.access.log file? Can I just change permissions/disable writing for all users or is there any option in /etc/evok.conf or other file?
This file (evok.access.log) can grow to big sizes if we constantly send requests from other applications (eg web interface; rest api), so I want to disable appending that file. -
RE: Wireless Access Point
@tomas_knot
"Have you changed your wifi configuration before turning it on? "
No, I haven't. What settings should I change (after fresh install) (in Raspbian Jessie Lite)? The only changes I made was configuration of WiFi (ssid, psk, key_mgmt) in /etc/wpa_supplicant/wpa_supplicant.conf (and wifi worked fine).
" And just to ask - which UniPi device do you have?"
I'm using Neuron. In first post there were errors, because I used installation instructions for "legacy version" from tutorial (not "Installation process for the 2.0 EVOK version"). After using "Installation process for the 2.0 EVOK version" installation was fine.
Quick Update (20.02.2018): I installed Raspbian Stretch Lite (instead of Raspbian Jessie Lite) and I don't have alert on html page. It looks like error was in older version of Raspbian. However I see WiFi network UNIPICONFIG only for few seconds; so it's not perfect - can't use AP mode yet.
-
RE: Wireless Access Point
@tomas_knot
I successfully installed evok (Raspian Jessie Lite), however there is small error when I turn on Wifi access point in web interface (chrome browser, win 10), in Configuration section :
Running evok in debugging mode (
$sudo python /opt/evok/evok.py
) shows following output:[I 180215 12:54:04 web:2064] 200 GET /rest/wifi/1_01/ (127.0.0.1) 3.43ms A dependency job for unipidns.service failed. See 'journalctl -xn' for details. [I 180215 12:54:06 web:2064] 200 POST /rest/wifi/1_01/ (::1) 51.68ms
and the similar error shows following command:
$ sudo systemctl start unipidns
:pi@raspberrypi:~ $ sudo systemctl start unipidns A dependency job for unipidns.service failed. See 'journalctl -xn' for details.
and there are no "journal files":
pi@raspberrypi:~ $ journalctl -xn No journal files were found.
What could be the problem and how can I try to solve it?
-
RE: Wireless Access Point
@tomas_knot
UPDATE: now installation works after using "Installation process for the 2.0 EVOK version" instead of "Installation process for the legacy version" (didn't know that there is difference)I decided to reinstall evok, however there are small problems. I tried with Raspbian Jessie Lite, Raspbian Stretch Lite, Raspbian Jessie Desktop and I followed installation instructions from https://github.com/UniPiTechnology/evok, but there is the same problem:
After stopping evok with$sudo systemctl stop evok
and running$sudo python /opt/evok/evok.py
I have following output:Listening on port: 80 Error in config section EPROM_1 - 'I2C read failed' Error in config section MCP_1 - 'I2C write failed' Error in config section RELAY_1 - Invalid device circuit number 1 Error in config section RELAY_2 - Invalid device circuit number 1 Error in config section RELAY_3 - Invalid device circuit number 1 Error in config section RELAY_4 - Invalid device circuit number 1 Error in config section RELAY_5 - Invalid device circuit number 1 Error in config section RELAY_6 - Invalid device circuit number 1 Error in config section RELAY_7 - Invalid device circuit number 1 Error in config section RELAY_8 - Invalid device circuit number 1 Error in config section AI_1 - Invalid device circuit number 1 Error in config section AI_2 - Invalid device circuit number 1 Entering measure loop Entering 1wire loop [I 180215 11:45:25 web:2064] 101 GET /ws (172.16.116.83) 3.33ms New WebSocket client connected [I 180215 11:45:25 web:2064] 304 GET /rest/all/ (172.16.116.83) 3.16ms
command
$sudo i2cdetect -y 1
gives output:0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 6f 70: -- -- -- -- -- -- -- --
UniPi worked before (for previous version of evok), so hardware is fine. How can I solve this problem?
PS: I enabled I2C, GPIO, SPI etc using raspi-config before installation (and checked it after installation)
PS: During installation I didn't have errors, but I noticed that installation script didn't ask me about anything (eg Wifi on or off)//I didn't have to make decisions during installation -
RE: Wireless Access Point
Thank you for quick response.
Is it possible to switch this function on after installation? Or the only option is reinstall evok? -
Wireless Access Point
Hello everyone.
How to create Wireless Access Point for UniPi (Neuron)? What are the step-by-step instructions for fresh evok installation on fresh raspbian operating system (Jessie or maybe Stretch) ?
I want to have backup solution in case when my local network or internet will not work; and I want to connect directly to unipi's evok from my local phone and tablet. I read on Evok product description page "https://www.unipi.technology/products/evok-47", that "Alongside the above EVOK includes basic Wi-Fi functionality. It can be used to provide a wireless access point (default APN: UNIPICONFIG, default password: "UniPi.technology")." , but how to configure it? -
RE: Direct Switch - setup example (without Mervis)
Thank you, I tested new version of Evok (with Raspbian Jessie) and it works great. Direct Switch works very good for any input/output.
I have additional question: is it possible to control 4 lights/4 relays using 1 button/1 Digital Input (or more, eg 4 inputs/4 buttons) with Direct Switch method (function toggle)? I want to control the same 4 lights using 4 different buttons (in different places in the room), so each button will turn on/off all the lights in the room. (**when we press any of 4 buttons than 4 lights will go on or off) -
Direct Switch - setup example (without Mervis)
I have a question related to Direct Switch function for UniPi (neuron) - how to setup it for simple input/output pair - DI 3.11 and RO 3.11 for example ? I need function toogle and I don't want to use Mervis.
It's important to do that, because this method is very fast and I use it for switching light on/off using wall switch and delay will be very small.
Operating system: Raspbian Jessie. I installed neuron tcp modbus overlay from"https://github.com/UniPiTechnology/neuron_tcp_modbus_overlay , but it's not clear how to configure it for simple example - eg input DI 3.11, output RO 3.11, function toogle.
Regards,
MP