I’m currently using an attiny as prefilter on the raspberry PI.
Is there a good reason why i should buy and install an Arduino as replacement?
Are there any advantages that are worth the work?
-
Arduino vs. attiny
-
If it works well for you then there is no reason to switch.
Some advantages of the arduino solution:
- Sending does not block you entire pi (for example sound outputs stop for a short time or your video would lag).
- Probably less missing receiving, when the cpu load is high, because the arduino is decoding the signal and no program must be scheduled in time.
- You could use the additional arduino digital or analog pins for other sensors / as gpio extension.
-
I think the only reason to use a Attiny is because of space. I can put the Raspberry Pi, Attiny45, RX and TX in a small raspberry case. Working great and looks great!
And the Attiny is cheaper ofc. But you need experience with soldering and programming the Attiny, but with pilight you can easily program the Attiny.
-
Well the price isn’t really a concern. You can get an Arduino nano very cheap.
Do you not solder the nano to a board? I’ve experienced running a 433mhz circuit on a breadboard results in poorer receiving results.
The points mentioned by @sweetpi are very interesting to know altough they doesn’t concern my as i’m only running pimatic on this particular raspberry. -
This is my attiny soldered.
-
sweebee
the arduino nano solution is not bigger than your solution.pimatic rocks!!!
-
I did some experiments with ninja-blocks a while back and got couple of their ninjacrust which fit nicely on top of the pi (like sweebee did with his homemade board) and the specs are:
- ATmega328 microcontroller
- Input voltage - 5V
- 32k Flash Memory
- 16Mhz Clock Speed
- 3 RGB LEDs (2 with PWM)
- 433Mhz Transceiver
I managed to flash the homeduino sketch on it the only issue I had was with pimatic-homeduino that refused to start with the pins that I had assigned for transceiver and receiver I ended up editing the .coffee file hoping I won’t have to redo this on each pimatic-homeduino update.
Pimatic, smart home made by smart folks, for the rest of us!
-
I would like to omit another option to the homeduino scheme: panStamp.
It’s a bit more expensive but:
- Arduino compatible (patch for IDE)
- 2 versions: Atmel (ATmega328) and NRG (TI CC430, u-proc with radio SoC)
- radio on-board for 433 and 868 (915 in the US) MHz
- the NRG version has hardware AES encryption
- with NRG version all pins can be used as interrupt
- voltage range: 2 - 3,6V (battery powered FTW!)
- supports SI7021 dual temp/humidity sensor (just solder it to the board!)
The first reason I came up with these is that I was looking for encrypted comms between my hallway and pimatic. I find it uncomfortable that some data is flung through the ether unencrypted. Like energy consumption or security status.
I dismissed that because of the board design that does not accomodate 433MHz comms, although the hardware can handle it with just a register change.But now my interest is back especially because of the 868Mhz.
I would like to control the heating in my appartment, but al the radio controlled radiator valves are operating on 868.I will probably order one (and a second Pi) and start experimenting. Sooooo I will keep you folks posted.
-
I tried to switch step by step from pilight to arduino.
i have a arduino nano here and tried to install the homeduino sketch to the arduino. but i get the following errors.
root@pimatic:~/pimatic-app/homeduino# make upload
Arduino.mk Configuration:
- [AUTODETECTED] CURRENT_OS = LINUX
- [USER] ARDMK_DIR = /root/pimatic-app/homeduino/arduino-mk
- [AUTODETECTED] ARDUINO_DIR = /usr/share/arduino
- [AUTODETECTED] ARDUINO_VERSION = 101
- [DEFAULT] ARCHITECTURE =
- [DEFAULT] VENDOR = arduino
- [DEFAULT] ARDUINO_SKETCHBOOK = /root/sketchbook
- [AUTODETECTED] AVR_TOOLS_DIR = /usr (found in $PATH)
- [COMPUTED] ARDUINO_LIB_PATH = /usr/share/arduino/libraries (from ARDUINO_DIR)
- [DEFAULT] ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino//cores/arduino
- [COMPUTED] ARDUINO_VAR_PATH = /usr/share/arduino/hardware/arduino//variants (from ARDUINO_DIR)
- [COMPUTED] BOARDS_TXT = /usr/share/arduino/hardware/arduino//boards.txt (from ARDUINO_DIR)
- [USER] USER_LIB_PATH = /root/pimatic-app/homeduino/libraries
- [DEFAULT] PRE_BUILD_HOOK = pre-build-hook.sh
- [USER] BOARD_TAG = uno
- [COMPUTED] OBJDIR = build-uno (from BOARD_TAG)
- [DETECTED] MONITOR_BAUDRATE = 115200 (in sketch)
- [DEFAULT] OPTIMIZATION_LEVEL = s
- [DEFAULT] MCU_FLAG_NAME = mmcu
- [DEFAULT] CFLAGS_STD =
- [DEFAULT] CXXFLAGS_STD =
- [COMPUTED] DEVICE_PATH = /dev/ttyACM0 (from MONITOR_PORT)
- [AUTODETECTED] Size utility: AVR-aware for enhanced output
- ARDUINO_LIBS =
- [USER] SerialCommand
- [USER] RFControl
- [USER] Keypad
- [USER] DHTlib
- [USER] Keypad/utility
- [COMPUTED] BOOTLOADER_PARENT = /usr/share/arduino/hardware/arduino//bootloaders (from ARDUINO_DIR)
- [COMPUTED] ARDMK_VERSION = 1.3.4
- [COMPUTED] CC_VERSION = 4.7.2 (avr-gcc)
mkdir -p build-uno
make reset
make[1]: Entering directory/root/pimatic-app/homeduino' /root/pimatic-app/homeduino/arduino-mk/bin/ard-reset-arduino /dev/ttyACM0 make[1]: Leaving directory
/root/pimatic-app/homeduino’
make do_upload
make[1]: Entering directory `/root/pimatic-app/homeduino’
/usr/bin/avrdude -q -V -D -p atmega328p -c arduino -b 115200 -P /dev/ttyACM0
-U flash:w:build-uno/homeduino.hex:i
avrdude: stk500_recv(): programmer is not respondingavrdude done. Thank you.
make[1]: *** [do_upload] Fehler 1
make[1]: Leaving directory `/root/pimatic-app/homeduino’
make: *** [upload] Fehler 2i have edited the makefile like this:
BOARD_TAG = uno
ARDUINO_LIBS = SerialCommand RFControl Keypad DHTlib
USER_LIB_PATH := $(realpath ./libraries)
MONITOR_PORT = /dev/ttyACM0board is connected to /dev/ttyACMo
i have no idea what i have todo next?
-
Why you changed from nano to uno if you got a nano?
Does /dev/ttyACMo appear as device? (ls -alh /dev/ttyACMo) -
i never had a nano. i have a arduino here since half year so i would give it a try and would not by a nano for now.
ls -alh /dev/ttyACMo
gives ls: Zugriff auf /dev/ttyACMo nicht möglich: Datei oder Verzeichnis nicht gefunden
but it works before. i have a energy consumption programm writen and it sends over serial baudrate 9600. so it should work
-
its a zero at the end, not a OOOOO
my fault
ls -alh /dev/ttyACM0
gives:
crw-rw—T 1 root dialout 166, 0 Feb 5 19:49 /dev/ttyACM0 -
Have you try to reset the uno (push the reset button) just after
/usr/bin/avrdude -q -V -D -p atmega328p -c arduino -b 115200 -P /dev/ttyACM0 -U flash:w:build-uno/homeduino.hex:i
I have an ATmega328p on a ninjacrust and that’s how I flashed mine.
Pimatic, smart home made by smart folks, for the rest of us!
-
i have now succesfully flashed the arduino. now i add the plugin to my config like this,
{
“plugin”: “homeduino”,
“driver”: “serialport”,
“driverOptions”: {
“serialDevice”: “/dev/ttyACM0”,
“baudrate”: 115200
},
“receiverPin”: 0,
“transmitterPin”: 4
}but when pimatic is started, after maybe five minutes it dies. reconnecting…
-
Does the logfile of pimatic says anything about that?
-
no just connected to homeduino
-
Could you raise the pimatic loglevel in the config to debug and post the last lines out of the log when a ‘crash’ happens?
-
i have added this to my settings config
“settings”: {
“httpServer”: {
“debug”: true,
“logLevel”: “debug”,
“enabled”: true,
“port”: 80,this is the whole pimatic-daemon.log
12:00:40.794 2015-02-06 Friday
12:00:52.867 [pimatic] info: Starting pimatic version 0.8.42
12:01:03.294 [pimatic] info: loading plugin: “pimatic-cron” (0.8.5)
12:01:04.086 [pimatic] info: loading plugin: “pimatic-homeduino” (0.8.36)
12:01:05.289 [pimatic] info: loading plugin: “pimatic-links” (0.8.5)
12:01:05.461 [pimatic] info: loading plugin: “pimatic-pushover” (0.8.1)
12:01:05.729 [pimatic] info: loading plugin: “pimatic-sysinfo” (0.8.10)
12:01:06.274 [pimatic] info: loading plugin: “pimatic-mobile-frontend” (0.8.42)
12:01:12.111 [pimatic] info: loading plugin: “pimatic-pilight” (0.8.6)
12:01:12.483 [pimatic] info: loading plugin: “pimatic-ping” (0.8.3)
12:01:12.800 [pimatic] info: loading plugin: “pimatic-log-reader” (0.8.2)
12:01:13.070 [pimatic] info: loading plugin: “pimatic-sunrise” (0.8.0)
12:01:13.356 [pimatic] info: loading plugin: “pimatic-shell-execute” (0.8.6)
12:01:13.583 [pimatic] info: loading plugin: “pimatic-gpio” (0.8.2)
12:01:14.079 [pimatic] info: loading plugin: “pimatic-weather” (0.8.9)
12:01:20.001 [pimatic-cron] info: the time is: Fri Feb 06 2015 12:01:19 GMT+0100 (CET)
12:01:21.352 [pimatic-sunrise] info: Your location is set to lat: 51.501, long: 7.3371
12:01:22.022 [pimatic] info: new device “Verbrauch aktueller Monat”…
12:01:22.204 [pimatic] info: new device “Kosten aktueller Monat”…
12:01:22.370 [pimatic] info: new device “Verbrauch letzter Monat”…
12:01:22.496 [pimatic] info: new device “Kosten letzter Monat”…
12:01:22.614 [pimatic] info: new device “Total Verbrauch”…
12:01:22.748 [pimatic] info: new device “Aktueller Verbrauch”…
12:01:22.965 [pimatic] info: new device “Mein Computer”…
12:01:23.110 [pimatic] info: new device “Router”…
12:01:23.239 [pimatic] info: new device “Media Center”…
12:01:23.376 [pimatic] info: new device “Logitech Multiroom Server”…
12:01:23.498 [pimatic] info: new device “Mein NAS”…
12:01:23.622 [pimatic] info: new device “Stefan Handy”…
12:01:23.732 [pimatic] info: new device “Cris Handy”…
12:01:23.967 [pimatic] info: new device “Stehlampe”…
12:01:24.099 [pimatic] info: new device “Weinregal”…
12:01:24.232 [pimatic] info: new device “Deckenlampe”…
12:01:24.372 [pimatic] info: new device “Schwarzlicht”…
12:01:24.510 [pimatic] info: new device “Nachttischlampe”…
12:01:24.646 [pimatic] info: new device “Isttemperatur”…
12:01:24.789 [pimatic] info: new device “Radio”…
12:01:24.933 [pimatic] info: new device “Wohntemperatur”…
12:01:25.073 [pimatic] info: new device “Balkonfenster”…
12:01:25.228 [pimatic] info: new device “Wohntemperatur Trend”…
12:01:25.383 [pimatic] info: new device “Ambiente”…
12:01:25.532 [pimatic] info: new device “Heizung Freigabe”…
12:01:25.657 [pimatic] info: new device “Aktuelles Ambiente”…
12:01:25.793 [pimatic] info: new device “CPU Auslastung”…
12:01:25.922 [pimatic] info: new device “CPU Temperatur”…
12:01:26.031 [pimatic] info: new device “Arbeitsspeichernutzung”…
12:01:26.149 [pimatic] info: new device “Festplattennutzung”…
12:01:26.270 [pimatic] info: new device “Datenbanknutzung”…
12:01:26.386 [pimatic] info: new device “Solltemperatur”…
12:01:26.521 [pimatic] info: new device “Nachtabsenkung”…
12:01:26.629 [pimatic] info: new device “Temp. einstellen”…
12:01:26.989 [pimatic] info: new device “Wetter Heute”…
12:01:27.160 [pimatic] info: new device “Wetter Morgen”…
12:01:27.304 [pimatic] info: new device “Restart Service”…
12:01:27.515 [pimatic] info: new device “Heizung”…
12:01:27.686 [pimatic] info: new device “Media Center”…
12:01:27.850 [pimatic] info: new device “Raspberry Reboot”…
12:01:28.011 [pimatic] info: new device “comming home”…
12:01:28.232 [pimatic] info: new device “Thermostat”…
12:01:28.396 [pimatic] info: new device “Media Center Wohnzimmer”…
12:01:28.591 [pimatic] info: new device “Heizung Laufzeit”…
12:01:28.752 [pimatic] info: new device “Kodi Media Center”…
12:01:28.912 [pimatic] info: new device “Computer”…
12:01:29.078 [pimatic] info: new device “NAS Server”…
12:04:28.009 [pimatic-pilight] info: pilight: trying to find pilight via SSDP
12:04:28.894 [pimatic-pilight] error: Could not send request to pilight-daemon { message: ‘send’,
12:04:28.894 [pimatic-pilight] error:> code: { location: ‘wohnen’, device: ‘radio’, state: ‘on’ } }
12:04:29.650 [pimatic] error: rule radio error executing an action: Could not send request to pilight-daemon
12:04:37.881 [pimatic] error: Error on evaluation of rule condition of rule radio: Could not send request to pilight-daemon
12:04:41.029 [pimatic-mobile-frontend] info: packing static assets
12:04:44.963 [pimatic-mobile-frontend] info: packing static assets finished
12:04:44.992 [pimatic-mobile-frontend] info: rendering html
12:05:13.422 [pimatic-mobile-frontend] info: rendering html finished
12:05:13.559 [pimatic] info: listening for http-request on port 80…
12:05:13.652 [pimatic-pilight] info: pilight: found pilight server 192.168.0.110:33866, trying to connect
12:05:13.993 [pimatic-pilight] info: connected to pilight-daemon
12:05:15.093 [pimatic-homeduino] info: Connected to homeduino device.at 12.09… it dies.
afterthat ive copied the above logfile.
-
Can you pls make a picture of your Nano?
My experience with Arduino is, that the Nano creates a ttyUSBx device and the Pro Micro a ttyAMCx.
The Pro Micro has a integrated USB2Serial converter which produced some failures on my system.pimatic rocks!!!
-
i connect my arduino uno to the raspberry pi over serial.
now i connected my transmitter on d4 and flash the arduino. this worked.then a add this to my config:
{ "plugin": "homeduino", "driver": "serialport", "driverOptions": { "serialDevice": "/dev/ttyACM0", "baudrate": 115200 }, "receiverPin": 0, "transmitterPin": 4 }
and start pimatic.
sometimes it would start. sometimes not.
when it startsi get a ping in debug. but after maybe 5 minutes i lost connection.
now i lost connection,
i get this:root@pimatic:~# ps aux | grep pimatic
root 3029 0.0 0.1 3596 852 pts/2 S+ 13:44 0:00 grep pimatic