pimatic / pimatic-homeduino

Pimatic plugin for using 433mhz devices and sensors with a connected Arduino with homeduino sketch
https://pimatic.org/
GNU General Public License v2.0
37 stars 29 forks source link

homeduino plugin don't receive #28

Closed Harrdy closed 9 years ago

Harrdy commented 9 years ago

if i connect via screen to arduino (screen /dev/ttyUSB0 115200) i see all

ready
PING hello
ACK
RF receive 676 4319 2028 10136 0 0 0 0 010201020102020101020102010202010102010202010201010201020102010202010102020101020102010201020102010201020102010201020102010201020102010201020102010201020102010202010102020101020201010202010201020103
RF receive 675 4320 2029 10132 0 0 0 0 010201020102020101020102010202010102010202010201010201020102010202010102020101020102010201020102010201020102010201020102010201020102010201020102010201020102010202010102020101020201010202010201020103
RF receive 294 966 378 9900 0 0 0 0 01010101011201120110011001120101011001100110010103
RF receive 319 952 9888 0 0 0 0 0 01010101011001100110011001100110011001101010101002
RF receive 298 970 384 9892 0 0 0 0 01010101011001100110011001100101011001120110010103
RF receive 254 974 388 9920 0 0 0 0 01010101011201120112011201120112010101120112010103
RF receive 305 967 9896 0 0 0 0 0 01010101011001100110011001100110010101100110010102
RF receive 675 4316 2026 10128 0 0 0 0 010201020102020101020201020102010102020102010201010201020102010201020201020101020102010201020102010201020102010201020102010201020102010201020102010201020102010201020201010202010201010202010102010203
RF receive 677 4314 2025 10124 0 0 0 0 010201020102020101020201020102010102020102010201010201020102010202010102020101020102010201020102010201020102010201020102010201020102010201020102010201020102010202010201020101020102020102010102010203
RF receive 698 4288 1999 10088 0 0 0 0 010201020102010202010201020102010201010202010102010201020102010201020201020101020102010201020102010201020102010201020102010201020102010201020102010201020102010201020201020102010102010201020102020103

My pimatic log say me this:

17:48:46.896 [pimatic-homeduino] info: Connected to homeduino device.
debug [pimatic-homeduino]: data: "ready"

i did'nt see any receive code.

It works for me until i'm updating homeduino plugin to last version

sweetpi commented 9 years ago

Could you post your plugin config?

Harrdy commented 9 years ago
    {
      "plugin": "homeduino",
      "driver": "serialport",
      "driverOptions": {
        "serialDevice": "/dev/ttyUSB0",
        "baudrate": 115200
      },
      "receiverPin": 0,
      "transmitterPin": 4,
      "debug": true
    }
[ 2097.126744] usb 1-1.3: new full-speed USB device number 5 using dwc_otg
[ 2097.230342] usb 1-1.3: New USB device found, idVendor=1a86, idProduct=7523
[ 2097.230383] usb 1-1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 2097.230403] usb 1-1.3: Product: USB2.0-Serial
[ 2097.238638] ch341 1-1.3:1.0: ch341-uart converter detected
[ 2097.243604] usb 1-1.3: ch341-uart converter now attached to ttyUSB0
Harrdy commented 9 years ago

i think the problem are the arduino sketch @arduino clone. if i'm trying to use the original sketch its not possible to send commands. (uploaded from rpi and win7 ide). at this sketch i'm see ready but can't send commands.

if i'm change the serialcommand lib and its possible to control the arduino from screen but not in pimatic. i'm order a another arduino (r3 uno) yesterday and waiting right now to receive it today. then i can try to use the original sketch on this arduino to work with pimatic.

sweetpi commented 9 years ago

It's important that you use my version of Arduino-SerialCommand: https://github.com/sweetpi/Arduino-SerialCommand

Best is to flash on the rpi using the makefile following to the README of homeduino (That's the only way I tested).

Harrdy commented 9 years ago

i'm received the new arduino right now. But your lib don't work. i'm flash the sketch from rpi with the MakeFile

on nano with

# Uses Arduino.mk https://github.com/sudar/Arduino-Makefile
BOARD_TAG    = nano
ARDUINO_LIBS = SerialCommand RFControl Keypad DHTlib
USER_LIB_PATH := $(realpath ./libraries)
MONITOR_PORT  = /dev/ttyUSB0

ARDMK_DIR := $(realpath ./arduino-mk)
include $(ARDMK_DIR)/Arduino.mk

and with uno r3

# Uses Arduino.mk https://github.com/sudar/Arduino-Makefile
BOARD_TAG    = uno
ARDUINO_LIBS = SerialCommand RFControl Keypad DHTlib
USER_LIB_PATH := $(realpath ./libraries)
MONITOR_PORT  = /dev/ttyACM0

ARDMK_DIR := $(realpath ./arduino-mk)
include $(ARDMK_DIR)/Arduino.mk

flash log

pi@raspberrypi ~/homeduino $ sudo make upload
-------------------------
Arduino.mk Configuration:
- [AUTODETECTED]       CURRENT_OS = LINUX
- [USER]               ARDMK_DIR = /home/pi/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 = /home/pi/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 '/home/pi/homeduino'
/home/pi/homeduino/arduino-mk/bin/ard-reset-arduino  /dev/ttyACM0
make[1]: Leaving directory '/home/pi/homeduino'
make do_upload
make[1]: Entering directory '/home/pi/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: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x1e950f
avrdude: reading input file "build-uno/homeduino.hex"
avrdude: writing flash (9882 bytes):
avrdude: 9882 bytes of flash written

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

make[1]: Leaving directory '/home/pi/homeduino'

same on nano but i can't send data to screen terminal und receive only one line ready i can't enter commands like ping on this terminal

*edit: pimatic work with your lib right now.

with the new uno r3 and your lib it works with pimatic

debug [pimatic-homeduino]: generic: { id: 1000, type: 2, positive: true, value: 378 }
12:36:19debug [pimatic-homeduino]: received: [ 698, 1997, 4284, 10084 ] 020102010201020101020102010201020102020101020201020102010201020101020201010202010201020102010201020102010201020102010201020102010201020102010201020102010201020101020201010201020102010202010102020103
12:36:19debug [pimatic-homeduino]: data: "RF receive 698 4284 1997 10084 0 0 0 0 010201020102010202010201020102010201010202010102010201020102010202010102020101020102010201020102010201020102010201020102010201020102010201020102010201020102010202010102020102010201020101020201010203"
12:36:18debug [pimatic-homeduino]: generic: { id: 1000, type: 1, positive: true, value: 219 }
12:36:18debug [pimatic-homeduino]: received: [ 699, 1996, 4285, 10088 ] 020102010201020101020102010201020102020101020201020102010201020102010102010202010201020102010201020102010201020102010201020102010201020102010201020102010201020102010102010202010102010202010102010203
12:36:18debug [pimatic-homeduino]: data: "RF receive 699 4285 1996 10088 0 0 0 0 010201020102010202010201020102010201010202010102010201020102010201020201020101020102010201020102010201020102010201020102010201020102010201020102010201020102010201020201020101020201020101020201020103"
12:36:17debug [pimatic-homeduino]: generic: { id: 1000, type: 1, positive: true, value: 219 }
12:36:17debug [pimatic-homeduino]: received: [ 699, 1997, 4283, 10088 ] 020102010201020101020102010201020102020101020201020102010201020102010102010202010201020102010201020102010201020102010201020102010201020102010201020102010201020102010102010202010102010202010102010203
12:36:17debug [pimatic-homeduino]: data: "RF receive 699 4283 1997 10088 0 0 0 0 010201020102010202010201020102010201010202010102010201020102010201020201020101020102010201020102010201020102010201020102010201020102010201020102010201020102010201020201020101020201020101020201020103"
12:35:56debug [pimatic-homeduino]: weather6: { id: 2, channel: 3, temperature: 25, humidity: 40, battery: 'Bad' }
12:35:56debug [pimatic-homeduino]: received: [ 569, 2072, 4128, 9030 ] 01010101010102010201010201010101020202020201020101020102010101020102010102030103
12:35:56debug [pimatic-homeduino]: data: "RF receive 569 2072 4128 9030 0 0 0 0 01010101010102010201010201010101020202020201020101020102010101020102010102030103"
12:35:38debug [pimatic-homeduino]: generic: { id: 1500, type: 2, positive: true, value: 430 }
12:35:38debug [pimatic-homeduino]: received: [ 690, 2011, 4298, 10100 ] 020102010201010202010102010201020201010201020102020102010201020101020201010202010201020102010201020102010201020102010201020102010201020102010201020102010201020101020102020101020201010201020102020103
12:35:38debug [pimatic-homeduino]: data: "RF receive 690 4298 2011 10100 0 0 0 0 010201020102020101020201020102010102020102010201010201020102010202010102020101020102010201020102010201020102010201020102010201020102010201020102010201020102010202010201010202010102020102010201010203"
12:35:37debug [pimatic-homeduino]: generic: { id: 1500, type: 1, positive: true, value: 180 }
12:35:37debug [pimatic-homeduino]: received: [ 690, 2010, 4298, 10100 ] 020102010201010202010102010201020201010201020102020102010201020102010102010202010201020102010201020102010201020102010201020102010201020102010201020102010201020102010102020101020102020101020201020103
12:35:37debug [pimatic-homeduino]: data: "RF receive 690 4298 2010 10100 0 0 0 0 010201020102020101020201020102010102020102010201010201020102010201020201020101020102010201020102010201020102010201020102010201020102010201020102010201020102010201020201010202010201010202010102010203"
12:35:36debug [pimatic-homeduino]: generic: { id: 1500, type: 1, positive: true, value: 180 }
12:35:36debug [pimatic-homeduino]: received: [ 690, 2011, 4299, 10104 ] 020102010201010202010102010201020201010201020102020102010201020102010102010202010201020102010201020102010201020102010201020102010201020102010201020102010201020102010102020101020102020101020201020103
12:35:36debug [pimatic-homeduino]: data: "RF receive 690 4299 2011 10104 0 0 0 0 010201020102020101020201020102010102020102010201010201020102010201020201020101020102010201020102010201020102010201020102010201020102010201020102010201020102010201020201010202010201010202010102010203"
12:35:14debug [pimatic-homeduino]: generic: { id: 1000, type: 2, positive: true, value: 377 }
12:35:14debug [pimatic-homeduino]: received: [ 699, 1996, 4284, 10080 ] 020102010201020101020102010201020102020101020201020102010201020101020201010202010201020102010201020102010201020102010201020102010201020102010201020102010201020101020201010201020102010202010201010203
12:35:14debug [pimatic-homeduino]: data: "RF receive 699 4284 1996 10080 0 0 0 0 010201020102010202010201020102010201010202010102010201020102010202010102020101020102010201020102010201020102010201020102010201020102010201020102010201020102010202010102020102010201020101020102020103"
12:35:13debug [pimatic-homeduino]: generic: { id: 1000, type: 1, positive: true, value: 219 }
12:35:13debug [pimatic-homeduino]: received: [ 698, 1998, 4284, 10096 ] 020102010201020101020102010201020102020101020201020102010201020102010102010202010201020102010201020102010201020102010201020102010201020102010201020102010201020102010102010202010102010202010102010203
12:35:13debug [pimatic-homeduino]: data: "RF receive 698 4284 1998 10096 0 0 0 0 010201020102010202010201020102010201010202010102010201020102010201020201020101020102010201020102010201020102010201020102010201020102010201020102010201020102010201020201020101020201020101020201020103"
12:35:12debug [pimatic-homeduino]: generic: { id: 1000, type: 1, positive: true, value: 219 }
12:35:12debug [pimatic-homeduino]: received: [ 699, 1997, 4283, 10088 ] 020102010201020101020102010201020102020101020201020102010201020102010102010202010201020102010201020102010201020102010201020102010201020102010201020102010201020102010102010202010102010202010102010203
12:35:12debug [pimatic-homeduino]: data: "RF receive 699 4283 1997 10088 0 0 0 0 010201020102010202010201020102010201010202010102010201020102010201020201020101020102010201020102010201020102010201020102010201020102010201020102010201020102010201020201020101020201020101020201020103"
12:35:03debug [pimatic-homeduino]: weather6: { id: 2, channel: 3, temperature: 24.9, humidity: 41, battery: 'Bad' }
12:35:03debug [pimatic-homeduino]: received: [ 569, 2078, 4126, 9044 ] 01010101010102010201010201010101020202020201010201020102010102020102010201030103
12:35:03debug [pimatic-homeduino]: data: "RF receive 569 2078 4126 9044 0 0 0 0 01010101010102010201010201010101020202020201010201020102010102020102010201030103"
12:34:34debug [pimatic-homeduino]: generic: { id: 1500, type: 2, positive: true, value: 430 }
12:34:34debug [pimatic-homeduino]: received: [ 690, 2010, 4298, 10100 ] 020102010201010202010102010201020201010201020102020102010201020101020201010202010201020102010201020102010201020102010201020102010201020102010201020102010201020101020102020101020201010201020102020103
12:34:34debug [pimatic-homeduino]: data: "RF receive 690 4298 2010 10100 0 0 0 0 010201020102020101020201020102010102020102010201010201020102010202010102020101020102010201020102010201020102010201020102010201020102010201020102010201020102010202010201010202010102020102010201010203"
12:34:33debug [pimatic-homeduino]: generic: { id: 1500, type: 2, positive: true, value: 430 }
12:34:33debug [pimatic-homeduino]: received: [ 690, 2011, 4297, 10100 ] 020102010201010202010102010201020201010201020102020102010201020101020201010202010201020102010201020102010201020102010201020102010201020102010201020102010201020101020102020101020201010201020102020103
12:34:33debug [pimatic-homeduino]: data: "RF receive 690 4297 2011 10100 0 0 0 0 010201020102020101020201020102010102020102010201010201020102010202010102020101020102010201020102010201020102010201020102010201020102010201020102010201020102010202010201010202010102020102010201010203"
12:34:31debug [pimatic-homeduino]: generic: { id: 1500, type: 1, positive: true, value: 180 }
12:34:31debug [pimatic-homeduino]: received: [ 690, 2010, 4298, 10104 ] 020102010201010202010102010201020201010201020102020102010201020102010102010202010201020102010201020102010201020102010201020102010201020102010201020102010201020102010102020101020102020101020201020103
12:34:31debug [pimatic-homeduino]: data: "RF receive 690 4298 2010 10104 0 0 0 0 010201020102020101020201020102010102020102010201010201020102010201020201020101020102010201020102010201020102010201020102010201020102010201020102010201020102010201020201010202010201010202010102010203"

but my nano clone get ready und still not work. but this is no problem yet. just i'm using the uno for future.

sweetpi commented 9 years ago

but my nano clone get ready und still not work. but this is no problem yet. just i'm using the uno for future.

There are reportings that the screen terminal does not work well (its difficult to use, too). I had no problems with all nano clones I tested, maybe yours has a defect.

Harrdy commented 9 years ago

i'm testing 6 arduino clones (all from the same seller) and all have the same problem. i think the serial2usb chip (CH340G) is the problem. As far as i know the different arduino clones are available with different serial2usb chips like CH340, CH340G, CH341.With the uno r3 it works without problems yet

sweetpi commented 9 years ago

I have a working one here with CH340G. Still strange.

sweetpi commented 9 years ago

It also could be that your power source is not strong enough. Did you check the voltage at the arduino?

Harrdy commented 9 years ago

I didn't check the voltage but i check this tonight and report.

But now if you say it. i'm changing my receiver 2 days ago from a cheap ebay receiver to a aurel rx-4m50rr30sf because the cheap receiver has a really bad range.

The different between the receivers is aurel has 2 vcc and 3 gnd connectors instead of 1vcc 1 gnd

Icesory commented 9 years ago

@Harrdy for general discussion you can use the Forum http://forum.pimatic.org/

You can login with your GitHub account