Very first attempt to solder smd components on pcb with hot air soldering station. lots of mistakes but i m learning...
pihome
@pihome
Best posts made by pihome
-
RE: What did you build today (Pictures) ?
-
Python script to communicate with serial gateway
Hi Guys,
This is more of missing piece of puzzle, i have googled a lot to find some simple way to communicate with mysensors gateway but google this time failed me hence i decided to do this myself.
i have this script running over one year, yes i have made some improvements over the year and here is final version. its self explanatory, feel free to use it as you wish and modify and if you think some improvements can be made let me know my ears are all yours...
i have this raspberry pi base heating control that i built but i m not sure if i can share it here and what are the implications etc.... until then have fun and enjoy creating things (IOT)....
#!/usr/bin/python print " " print " _____ _ _ _ " print " | __ \ (_) | | | | " print " | |__) | _ | |__| | ___ _ __ ___ ___ " print " | ___/ | | | __ | / _ \ | |_ \_ \ / _ \ " print " | | | | | | | | | (_) | | | | | | | | __/" print " |_| |_| |_| |_| \___/ |_| |_| |_| \___|" print " " print " S M A R T H E A T I N G C O N T R O L " print "*******************************************************" print "* Serial Gateway Build for Wireless sensors using *" print "* MySeonsors serial API Build Date: 18/09/2017 *" print "* Have Fun - PiHome.eu *" print "*******************************************************" print " " print " " import MySQLdb as mdb import sys import serial import time # ps. you can troubleshoot with "screen" #screen /dev/ttyAMA0 115200 ser = serial.Serial('/dev/ttyAMA0', 115200, timeout=0) in_str = ser.readline() print in_str while 1: try: con = mdb.connect('localhost', 'root', 'passw0rd', 'pihome') # MySQL Database Connection Settings cur = con.cursor() Cursor object to Current Connection cur.execute('SELECT COUNT(*) FROM `messages_out` where sent = 0') # MySQL query statement count = cur.fetchone() # Grab all messages from database for Outgoing. count = count[0] # Parse first and the only one part of data table named "count" - there is number of records grabbed in SELECT above if count > 0: #If greater then 0 then we have something to send out. print "Total Messages to Sent : ",count # Print how many Messages we have to send out. cur.execute('SELECT * FROM `messages_out` where sent = 0') #grab all messages that where not send yet (sent ==0) msg = cur.fetchone(); #Grab first record and build a message: if you change table fields order you need to change following lines as well. out_id = int(msg[0]) #Record ID - only DB info, out_node_id = msg[1] #Node ID out_child_id = msg[2] #Child ID of the node where sensor/relay is attached. out_sub_type = msg[3] #Command Type out_ack = msg[4] #Ack req/resp out_type = msg[5] #Type out_payload = msg[6] #Payload to send out. sent = msg[7] #Status of message either its sent or not. (1 for sent, 0 for not sent yet) print "Date & Time: ",time.ctime() print "Message From Database: ",out_id, out_node_id, out_child_id, out_sub_type, out_ack, out_type, out_payload, sent #Print what will be sent including record id and sent status. msg = str(out_node_id) #Node ID msg += ';' #Separator msg += str(out_child_id) #Child ID of the Node. msg += ';' #Separator msg += str(out_sub_type) msg += ';' #Separator msg += str(out_ack) msg += ';' #Separator msg += str(out_type) msg += ';' #Separator msg += str(out_payload) #Payload from DB msg += ' \n' #New line print "Full Message to Send: ",msg #Print Full Message print "Node ID: ",out_node_id print "Child Sensor ID: ",out_child_id print "Command Type: ",out_sub_type print "Ack Req/Resp: ",out_ack print "Type: ",out_type print "Pay Load: ",out_payload print " \n" # node-id ; child-sensor-id ; command ; ack ; type ; payload \n ser.write(msg) # !!!! send it to serial (arduino attached to rPI by USB port) # help http://stackoverflow.com/questions/21740359/python-mysqldb-typeerror-not-all-arguments-converted-during-string-formatting cur.execute('UPDATE `messages_out` set sent=1 where id=%s', [out_id]) #update DB so this message will not be processed in next loop con.commit() #commit above except mdb.Error, e: print "Error %d: %s" % (e.args[0], e.args[1]) sys.exit(1) finally: if con: con.close() in_str = ser.readline() #Here is receiving part of the code # ..:: Un-comments Following two lines to see what you are receing and size of string ::.. # print "Size of String: ", sys.getsizeof(in_str)," \n" # print "String as Received: ",in_str," \n" if not sys.getsizeof(in_str) <= 22 : # and in_str[:1] == '0': #here is the line where sensor IDs over 100 are processed print "Date & Time: ",time.ctime() print "Size of the String: ", sys.getsizeof(in_str) print "Full String Received: ",in_str statement = in_str.split(";") print "Full Statement Received: ",statement node_id = int(statement[0]) print "Node ID: ",node_id child_sensor_id = int(statement[1]) print "Child Sensor ID: ",child_sensor_id message_type = int(statement[2]) print "Message Type: ",message_type ack = int(statement[3]) print "Acknowledge: ",ack sub_type = int(statement[4]) print "Sub Type: ",sub_type payload = statement[5] print "Pay Load: ",payload try: con = mdb.connect('localhost', 'root', 'passw0rd', 'pihome')#Database Connection Settings cur = con.cursor() # ..::Step One::.. # First time sensor comes online and add node to nodes table, if (child_sensor_id != 255 and message_type == 0): cur.execute('SELECT COUNT(*) FROM `nodes` where node_id = (%s)', (node_id)) row = cur.fetchone() row = int(row[0]) if (row == 0): print "1 Add Node: ", node_id, " Child Sensor ID:", child_sensor_id cur.execute('INSERT INTO nodes(node_id, child_id_1) VALUES(%s,%s)', (node_id,child_sensor_id)) con.commit() # ..::Step Two ::.. # Add Nodes name ie. relay, temperature sensor etc... to Database if (child_sensor_id == 255 and message_type == 3 and sub_type == 11): payload = payload[:-1] # remove \n from payload otherwise you will endup two lines sensors name in database. print "2 Update NodeID:", node_id, "Child Sensor ID:", child_sensor_id, " Sensor Type:", payload cur.execute('UPDATE nodes SET name = %s where node_id = %s', (payload, node_id)) con.commit() # ..::Step Three ::.. # Add Nodes MySensors Version to database if (node_id != 0 and child_sensor_id == 255 and message_type == 0 and sub_type == 17): payload = payload[:-1] # remove \n from payload otherwise you will endup two lines sensors name in database. print "3 Update NodeID:", node_id, "Child Sensor ID:", child_sensor_id, " Sensor Type:", payload cur.execute('UPDATE nodes SET ms_version = %s where node_id = %s', (payload, node_id)) con.commit() # ..::Step Four ::.. # Add Nodes MySensors Version to database if (node_id != 0 and child_sensor_id == 255 and message_type == 3 and sub_type == 12): payload = payload[:-1] # remove \n from payload otherwise you will endup two lines sensors name in database. print "4 Update NodeID:", node_id, "Child Sensor ID:", child_sensor_id, " Sensor Type:", payload cur.execute('UPDATE nodes SET sketch_version = %s where node_id = %s', (payload, node_id)) con.commit() # ..::Step Five::.. # Add temperature Reading to database if (node_id != 0 and child_sensor_id != 255 and message_type == 1 and sub_type == 0): print "5. Adding Database Record: Node ID:", node_id, " Child Sensor ID:", child_sensor_id, " PayLoad:", payload, "\n" cur.execute('INSERT INTO messages_in(node_id, child_id, sub_type, payload) VALUES(%s,%s,%s,%s)', (node_id,child_sensor_id,sub_type,payload)) con.commit() cur.execute('UPDATE `nodes` SET `last_seen`=now() WHERE node_id = %s', [node_id]) con.commit() # ..::Step Six::.. # Add Battery Level to Database # 20;255;3;0;0;102 if (child_sensor_id == 255 and message_type == 3 and sub_type == 0): #BATTERY Level print "6. Adding Database Record: Node ID:", node_id, " Battery Level:", payload, "Battery Voltage ", b_volt, "\n" cur.execute('INSERT INTO nodes_battery(node_id, bat_level, bat_voltage) VALUES(%s,%s,%s)', (node_id,payload,b_volt)) cur.execute('UPDATE `nodes` SET `last_seen`=now() WHERE node_id = %s', [node_id]) con.commit() # ..::Step Seven::.. # Add Battery Voltage to Database # 20;1;1;0;38;3.78 # node-id ; child-sensor-id ; command ; ack ; type ; payload \n if (child_sensor_id != 255 and message_type == 1 and sub_type == 38): #BATTERY VOLTAGE b_volt = payload # ..::Step Eight::.. # Add Bost Status Level to Database if (node_id != 0 and child_sensor_id != 255 and message_type == 1 and sub_type == 2): # print "2 insert: ", node_id, " , ", child_sensor_id, "payload", payload print "8. Adding Database Record: Node ID:", node_id, " Child Sensor ID:", child_sensor_id, " PayLoad:", payload, "\n" xboost = "UPDATE boost SET status=%s WHERE boost_button_id=%s AND boost_button_child_id = %s" cur.execute(xboost, (payload, node_id,child_sensor_id,)) con.commit() cur.execute('UPDATE `nodes` SET `last_seen`=now() WHERE node_id = %s', [node_id]) con.commit() except mdb.Error, e: print "Error %d: %s" % (e.args[0], e.args[1]) sys.exit(1) finally: if con: con.close() time.sleep(1) ``` Table for all in-coming message in mysql database:
CREATE TABLE
messages_in
(
id
INT(11) NOT NULL AUTO_INCREMENT,
node_id
TINYINT(4) NULL DEFAULT NULL,
child_id
TINYINT(4) NULL DEFAULT NULL,
sub_type
INT(11) NULL DEFAULT NULL,
payload
DECIMAL(10,2) NULL DEFAULT NULL,
datetime
TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id
)
)
COLLATE='utf16_bin'
ENGINE=InnoDB
AUTO_INCREMENT=1;Table for all outgoing message in mysql database:
CREATE TABLE
messages_out
(
id
INT(11) NOT NULL AUTO_INCREMENT,
node_id
INT(11) NOT NULL COMMENT 'Node ID',
child_id
INT(11) NOT NULL COMMENT 'Child Sensor',
sub_type
INT(11) NOT NULL COMMENT 'Command Type',
ack
INT(11) NOT NULL COMMENT 'Ack Req/Resp',
type
INT(11) NOT NULL COMMENT 'Type',
payload
VARCHAR(100) NOT NULL COMMENT 'Payload' COLLATE 'utf8_general_ci',
sent
TINYINT(1) NOT NULL DEFAULT '0' COMMENT 'Sent Status 0 No - 1 Yes',
datetime
TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Current datetime',
zone_id
INT(11) NOT NULL COMMENT 'Zone ID related to this entery',
PRIMARY KEY (id
)
)
COLLATE='utf32_bin'
ENGINE=InnoDB
AUTO_INCREMENT=1;``` -
RE: What did you build today (Pictures) ?
very first working Ethernet gateway
-
RE: ds18b20 on 2xAAA battery
@avelo
thank you for suggestion, i have made prototype based on MIC5219-3.3
but sure TPS61291 / TPS61221 are good options. once i get pcb delivered i'll you know here. -
RE: Raspberry Pi3 alternative?
i know this is old thread but here is what i have to deal with, truck load of different sd card ordered from amazon from different supplier, some full filled by amazon and some sold by amazon and all of them are fake and devil is in serial number so until you order more then one SD card you can never know if its real or fake.
-
RE: What did you build today (Pictures) ?
working on GPIO MySensors Gateway
-
RE: WiFi Gateway (ESP8266) - reconnect to wifi router
@thomasdr thank you for the info, and sorry for late reply, changing wait(500) to delay(500) worked.
-
PiHome - Smart Heating Control Available To download
Hi Guys,
i thought i better start new thread here instead hijacking someone's, i have uploaded all the code on http://www.pihome.eu i can answer any question you have here. its open source raspberry pi based smart heating control.
Thank you to all MySensorss Community other wise this project wasn't easy to make it wireless.
PiHome -
RE: [Tutorial] How to burn 1Mhz & 8Mhz bootloader using Arduino IDE 1.6.5-r5
First of all thanks to all who worked on this tutorial and bootloaders. i got fascinated about 8mhz and 1mhz with internal clock after reading this tutorial.
Some might say 1mhz 8 times slower then 8mhz hence need longer awake time to do perform task before it can go back to sleep and consumes more power but what i found: point is not it takes 8 times longer to perform task but it can run it on battery longer and on lower voltage when battery ist at its peak youth.
Anyway i wanted to share my experience and errors i had and the fix i found after googling around and spending hours trying to figure out what is going on.
if you follow instructions as it is then you will end up with second boards.txt file located at C:\Program Files (x86)\Arduino\hardware\breadboard\avr\boards.txt, this file contact info about ATmegaBOOT_168_atmega328_pro_8MHz.hex only. So far so good and it works but for some reason when i try to add 1mhz bootloader to C:\Program Files (x86)\Arduino\hardware\arduino\avr\boards.txt it just wouldn't work, the 1mhz bootloader wouldn't show in in board selection option but if i add info about 1mhz bootloader to "C:\Program Files (x86)\Arduino\hardware\breadboard\avr\boards.txt" then i could see option for "APM Optiboot internal 1MHz noBOD 9600baud" but when i try to burn this bootloader i get all sorts of error on burning bootloader, one of the error: Could not find tool avrdude (sorry didn't copy all error messages)
Then some forums suggest to start clean i.e uninstall Arduino ID and reinstall but simply uninstalling and reinstalling ID doesn't work you need to delete Arduino15 folder from following location(s) and reinstall Arduino ID:
C:\Users(username)\AppData\Local\Arduino15 or C:\Users<username>\AppData\Roaming\Arduino15 or C:\Users<username>\AppData\Local\Arduino15What i think is best to keep your boards.txt file in one location and modify it and add bootloaders in it and this worked for me. Simply copy your bootloaders to C:\Program Files (x86)\Arduino\hardware\arduino\avr\bootloaders and modify C:\Program Files (x86)\Arduino\hardware\arduino\avr\boards.txt for additional bootloaders.
here is my boards.txt############################################################## # Add the new board to boards.txt (normally located at "C:\Program Files\Arduino\hardware\arduino\avr" # The *.bootloader.* etries only matters if you want to program bootloader (and fuses) from Arduino IDE. # See http://www.engbedded.com/fusecalc (select Atmega328p) for interpretation of fuse values and how # extended fuses are written in different applications (07h in Arduino IDE = FFh in Atmel studio). ############################################################## apm96.name=APM Optiboot internal 1MHz noBOD 9600baud apm96.upload.tool=avrdude apm96.upload.protocol=arduino apm96.upload.maximum_size=32256 apm96.upload.speed=9600 apm96.bootloader.tool=avrdude apm96.bootloader.low_fuses=0x62 apm96.bootloader.high_fuses=0xde # all the possible values: #bootloader.extended_fuses=0x04 -> BOD at 4.3V #bootloader.extended_fuses=0x05 -> BOD at 2.7V #bootloader.extended_fuses=0x06 -> BOD at 1.8V #bootloader.extended_fuses=0x07 -> BOD disabled apm96.bootloader.extended_fuses=0x07 apm96.bootloader.path=optiboot_v50 apm96.bootloader.file=atmega328_1a.hex apm96.bootloader.unlock_bits=0x3F apm96.bootloader.lock_bits=0x2F apm96.build.mcu=atmega328p apm96.build.f_cpu=1000000L apm96.build.core=arduino apm96.build.variant=standard ############################################################## ############################################################## atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock) atmega328bb.upload.protocol=arduino atmega328bb.upload.maximum_size=30720 atmega328bb.upload.speed=57600 atmega328bb.bootloader.low_fuses=0xE2 atmega328bb.bootloader.high_fuses=0xDA atmega328bb.bootloader.extended_fuses=0x05 atmega328bb.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex atmega328bb.bootloader.unlock_bits=0x3F atmega328bb.bootloader.lock_bits=0x0F atmega328bb.build.mcu=atmega328p atmega328bb.build.f_cpu=8000000L atmega328bb.build.core=arduino:arduino atmega328bb.build.variant=arduino:standard atmega328bb.bootloader.tool=arduino:avrdude atmega328bb.upload.tool=arduino:avrdude```
-
RE: ERROR connect: Connection refused: Gateway on Raspberry pi 3 Model B Rev: 1.2
@mfalkvidd thank, i got it working but i think pi gateway isn't reliable or its just me once every while i get DEBUG !TSF:RTE:100 UNKNOWN whereas esp gateway works flawless
Aug 05 11:31:36 INFO Starting gateway... Aug 05 11:31:36 INFO Protocol version - 2.3.0 Aug 05 11:31:36 DEBUG Serial port /dev/ttyMySensorsGateway (115200 baud) created Aug 05 11:31:36 DEBUG MCO:BGN:INIT GW,CP=RNNGL-Q-,VER=2.3.0 Aug 05 11:31:36 DEBUG TSF:LRT:OK Aug 05 11:31:36 DEBUG TSM:INIT Aug 05 11:31:36 DEBUG TSF:WUR:MS=0 Aug 05 11:31:36 DEBUG TSM:INIT:TSP OK Aug 05 11:31:36 DEBUG TSM:INIT:GW MODE Aug 05 11:31:36 DEBUG TSM:READY:ID=0,PAR=0,DIS=0 Aug 05 11:31:36 DEBUG MCO:REG:NOT NEEDED Aug 05 11:31:36 DEBUG MCO:BGN:STP Aug 05 11:31:36 DEBUG MCO:BGN:INIT OK,TSP=1 Aug 05 11:31:45 DEBUG TSF:MSG:READ,26-26-0,s=255,c=3,t=0,pt=1,l=1,sg=0:82 Aug 05 11:32:23 DEBUG TSF:MSG:READ,25-25-0,s=1,c=1,t=38,pt=7,l=5,sg=0:0.28 Aug 05 11:32:23 DEBUG TSF:MSG:READ,25-25-0,s=255,c=3,t=0,pt=1,l=1,sg=0:6 Aug 05 11:32:27 DEBUG TSF:MSG:READ,21-21-0,s=0,c=1,t=0,pt=7,l=5,sg=0:23.0 Aug 05 11:32:45 DEBUG TSF:MSG:READ,26-26-0,s=255,c=3,t=0,pt=1,l=1,sg=0:82 Aug 05 11:33:25 DEBUG TSF:MSG:READ,25-25-0,s=1,c=1,t=38,pt=7,l=5,sg=0:0.28 Aug 05 11:33:25 DEBUG TSF:MSG:READ,25-25-0,s=255,c=3,t=0,pt=1,l=1,sg=0:6 Aug 05 11:33:45 DEBUG TSF:MSG:READ,26-26-0,s=1,c=1,t=38,pt=7,l=5,sg=0:3.45 Aug 05 11:33:45 DEBUG TSF:MSG:READ,26-26-0,s=255,c=3,t=0,pt=1,l=1,sg=0:82 Aug 05 11:34:01 DEBUG TSF:MSG:SEND,0-0-101-101,s=1,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=OK:0 Aug 05 11:34:01 DEBUG TSF:MSG:READ,101-101-0,s=1,c=1,t=2,pt=0,l=2,sg=0:0 Aug 05 11:34:01 DEBUG TSF:MSG:ACK Aug 05 11:34:02 DEBUG TSF:MSG:SEND,0-0-101-101,s=3,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=OK:0 Aug 05 11:34:02 DEBUG TSF:MSG:READ,101-101-0,s=3,c=1,t=2,pt=0,l=2,sg=0:0 Aug 05 11:34:02 DEBUG TSF:MSG:ACK Aug 05 11:34:03 DEBUG !TSF:RTE:100 UNKNOWN Aug 05 11:34:03 DEBUG !TSF:MSG:SEND,0-0-100-100,s=1,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=NACK:0 Aug 05 11:34:26 DEBUG TSF:MSG:READ,25-25-0,s=1,c=1,t=38,pt=7,l=5,sg=0:0.28 Aug 05 11:34:26 DEBUG TSF:MSG:READ,25-25-0,s=255,c=3,t=0,pt=1,l=1,sg=0:6 Aug 05 11:34:27 DEBUG TSF:MSG:READ,25-25-0,s=0,c=1,t=0,pt=7,l=5,sg=0:23.4 Aug 05 11:34:46 DEBUG TSF:MSG:READ,26-26-0,s=1,c=1,t=38,pt=7,l=5,sg=0:3.45 Aug 05 11:35:02 DEBUG TSF:MSG:SEND,0-0-101-101,s=1,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=OK:0 Aug 05 11:35:02 DEBUG TSF:MSG:READ,101-101-0,s=1,c=1,t=2,pt=0,l=2,sg=0:0 Aug 05 11:35:02 DEBUG TSF:MSG:ACK Aug 05 11:35:03 DEBUG TSF:MSG:SEND,0-0-101-101,s=3,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=OK:0 Aug 05 11:35:03 DEBUG TSF:MSG:READ,101-101-0,s=3,c=1,t=2,pt=0,l=2,sg=0:0 Aug 05 11:35:03 DEBUG TSF:MSG:ACK Aug 05 11:35:04 DEBUG !TSF:RTE:100 UNKNOWN Aug 05 11:35:04 DEBUG !TSF:MSG:SEND,0-0-100-100,s=1,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=NACK:0 Aug 05 11:35:18 DEBUG TSF:MSG:READ,20-20-0,s=0,c=1,t=0,pt=7,l=5,sg=0:21.3 Aug 05 11:35:28 DEBUG TSF:MSG:READ,25-25-0,s=1,c=1,t=38,pt=7,l=5,sg=0:0.28 Aug 05 11:35:28 DEBUG TSF:MSG:READ,25-25-0,s=255,c=3,t=0,pt=1,l=1,sg=0:6 Aug 05 11:35:29 DEBUG TSF:MSG:READ,25-25-0,s=0,c=1,t=0,pt=7,l=5,sg=0:23.5 Aug 05 11:36:01 DEBUG TSF:MSG:SEND,0-0-101-101,s=1,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=OK:0 Aug 05 11:36:01 DEBUG TSF:MSG:READ,101-101-0,s=1,c=1,t=2,pt=0,l=2,sg=0:0 Aug 05 11:36:01 DEBUG TSF:MSG:ACK Aug 05 11:36:02 DEBUG TSF:MSG:SEND,0-0-101-101,s=2,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=OK:0 Aug 05 11:36:02 DEBUG TSF:MSG:READ,101-101-0,s=2,c=1,t=2,pt=0,l=2,sg=0:0 Aug 05 11:36:02 DEBUG TSF:MSG:ACK Aug 05 11:36:03 DEBUG !TSF:RTE:100 UNKNOWN Aug 05 11:36:03 DEBUG !TSF:MSG:SEND,0-0-100-100,s=1,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=NACK:0 Aug 05 11:36:16 DEBUG TSF:MSG:READ,101-101-255,s=255,c=3,t=7,pt=0,l=0,sg=0: Aug 05 11:36:16 DEBUG TSF:MSG:BC Aug 05 11:36:16 DEBUG TSF:MSG:FPAR REQ,ID=101 Aug 05 11:36:16 DEBUG TSF:PNG:SEND,TO=0 Aug 05 11:36:16 DEBUG TSF:CKU:OK Aug 05 11:36:16 DEBUG TSF:MSG:GWL OK Aug 05 11:36:17 DEBUG TSF:MSG:SEND,0-0-101-101,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0 Aug 05 11:36:17 DEBUG TSF:MSG:READ,20-20-0,s=0,c=1,t=0,pt=7,l=5,sg=0:21.2 Aug 05 11:36:18 DEBUG TSF:MSG:READ,101-101-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1 Aug 05 11:36:18 DEBUG TSF:MSG:PINGED,ID=101,HP=1 Aug 05 11:36:18 DEBUG TSF:MSG:SEND,0-0-101-101,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1 Aug 05 11:36:18 DEBUG TSF:MSG:READ,101-101-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 Aug 05 11:36:18 DEBUG TSF:MSG:SEND,0-0-101-101,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 Aug 05 11:36:18 DEBUG TSF:MSG:READ,101-101-0,s=255,c=0,t=18,pt=0,l=5,sg=0:2.1.1 Aug 05 11:36:18 DEBUG TSF:MSG:READ,101-101-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0 Aug 05 11:36:20 DEBUG TSF:MSG:READ,101-101-0,s=255,c=3,t=11,pt=0,l=21,sg=0:Zone Controller Relay Aug 05 11:36:20 DEBUG TSF:MSG:READ,101-101-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.2 Aug 05 11:36:20 DEBUG TSF:MSG:READ,101-101-0,s=1,c=0,t=3,pt=0,l=0,sg=0: Aug 05 11:36:20 DEBUG TSF:MSG:READ,101-101-0,s=2,c=0,t=3,pt=0,l=0,sg=0: Aug 05 11:36:20 DEBUG TSF:MSG:READ,101-101-0,s=3,c=0,t=3,pt=0,l=0,sg=0: Aug 05 11:36:20 DEBUG TSF:MSG:READ,101-101-0,s=4,c=0,t=3,pt=0,l=0,sg=0: Aug 05 11:36:20 DEBUG TSF:MSG:READ,101-101-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2 Aug 05 11:36:20 DEBUG TSF:MSG:SEND,0-0-101-101,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1 Aug 05 11:36:30 DEBUG TSF:MSG:READ,21-21-0,s=0,c=1,t=0,pt=7,l=5,sg=0:22.9 Aug 05 11:36:30 DEBUG TSF:MSG:READ,25-25-0,s=1,c=1,t=38,pt=7,l=5,sg=0:0.28 Aug 05 11:36:30 DEBUG TSF:MSG:READ,25-25-0,s=255,c=3,t=0,pt=1,l=1,sg=0:6 Aug 05 11:36:46 DEBUG TSF:MSG:READ,26-26-0,s=1,c=1,t=38,pt=7,l=5,sg=0:3.45 Aug 05 11:36:46 DEBUG TSF:MSG:READ,26-26-0,s=255,c=3,t=0,pt=1,l=1,sg=0:82 Aug 05 11:37:02 DEBUG TSF:MSG:SEND,0-0-101-101,s=1,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=OK:0 Aug 05 11:37:02 DEBUG TSF:MSG:READ,101-101-0,s=1,c=1,t=2,pt=0,l=2,sg=0:0 Aug 05 11:37:02 DEBUG TSF:MSG:ACK Aug 05 11:37:03 DEBUG TSF:MSG:SEND,0-0-101-101,s=3,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=OK:0 Aug 05 11:37:03 DEBUG TSF:MSG:READ,101-101-0,s=3,c=1,t=2,pt=0,l=2,sg=0:0 Aug 05 11:37:03 DEBUG TSF:MSG:ACK Aug 05 11:37:04 DEBUG !TSF:RTE:100 UNKNOWN Aug 05 11:37:04 DEBUG !TSF:MSG:SEND,0-0-100-100,s=1,c=1,t=2,pt=0,l=2,sg=0,ft=0,st=NACK:0 Aug 05 11:37:30 DEBUG TSF:MSG:READ,21-21-0,s=0,c=1,t=0,pt=7,l=5,sg=0:23.0 Aug 05 11:37:32 DEBUG TSF:MSG:READ,25-25-0,s=1,c=1,t=38,pt=7,l=5,sg=0:0.28 Aug 05 11:37:32 DEBUG TSF:MSG:READ,25-25-0,s=255,c=3,t=0,pt=1,l=1,sg=0:6
Latest posts made by pihome
-
RE: 2021 EU customs regulatory changes — where should I buy now?
my experience is different, aliexpress is collected vat on purchase and item was shipped from Netherlands
Price: 11.29€
VAT (collected by Aliexpress): 2.59€
my post office sent me email asking for pay 6.09€ (2.59vat and 3.50 fee) and there is no way of contacting them or sending pre-paid vat just a reference number to pay vat online. -
RE: LoRa Gpio serial gateway
i havent tested lora on serial gateway but i had issues using 3.3v arduino, for me fix was 5v arduino with logic converter.
-
RE: What did you build today (Pictures) ?
very first working Ethernet gateway
-
Making WiFiManager compatible with MySensors 2.3.2
Its not bug but a workaround just in case if any one is searching for solution. I was using WiFiManager with MySensors 2.3.1 for WiFi gateway and it was working fine and now i upgraded MySensors from 2.3.1 to 2.3.2 and my WiFi gateway sketch refuse to compile. for the time being workaround: You need to comment out two location in core/MyGatewayTransportEthernet.cpp
may be there is better way but this is quick fix.Line 49 to 55
/* #if defined(MY_GATEWAY_ESP8266) || defined(MY_GATEWAY_ESP32) #if !defined(MY_WIFI_SSID) #error ESP8266/ESP32 gateway: MY_WIFI_SSID not defined! #endif #endif */
Line 184 to 189
/* (void)WiFi.begin(MY_WIFI_SSID, MY_WIFI_PASSWORD, 0, MY_WIFI_BSSID); while (WiFi.status() != WL_CONNECTED) { delay(1000); GATEWAY_DEBUG(PSTR("GWT:TIN:CONNECTING...\n")); } GATEWAY_DEBUG(PSTR("GWT:TIN:IP: %s\n"), WiFi.localIP().toString().c_str());*/
-
RE: NRF24L01 +PA+LNA right seller from Aliexpress
@hira
No, dimensions are different -
RE: OTA:FWP:UPDATE SKIPPED :(
just tired with different fuse settings bootloader.low_fuses=0xE2 but no success
2088 TSM:FPAR:OK 2088 TSM:ID 2091 TSM:ID:OK 2093 TSM:UPL 2097 2193 TSF:MSG:READ,0-0-1⸮2209 TSF:MSG:SEND,1-1-0-0,s=255,c=4,t=0,pt=6,l=10,sg=0,ft.Wz-⸮0100 2410 TSF:MSG:READ,0-0-1,s=255,c=3,t=15,pt=6,l=2,sg=0:012428 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0 >TSF:MSG:READ,0-0-1,s=0,c=4,t=1,pt=6,l=8,sg=0:20000100D00374A3 2674 OTA:FWP:UPDATE 26⸮2791 TSF:MSG:READ,0-0-1,s=255,c=3,t=6,pt=0,⸮⸮⸮Blank Over The Air Node 2811 TSF:MSG:SEND,1-1-0-0,s=255⸮MMi⸮3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 3088 MCO:BGN:STP 3090 MCO:BGN:INIT OK,TSP=1 24172 TSF:MSG:READ,0-0-1,s=0,c=4,t=1,pt=6,l=8,sg=0:20000100D00374A3 24178 OTA:FWP:UPDATE
-
OTA:FWP:UPDATE SKIPPED :(
Hi All,
i had some spare time and thought to play with OTA, i have burned bootloader with right channel and then upload blank sketch with, i have swapped the arduino just in case.MySensors version 2.3.1
ESP8266 Gateway.
hex file size is 43KB
can any one see what i m doing wrong?Blank sketch:
// Enable debug prints to serial monitor #define MY_DEBUG //Set MY_SPLASH_SCREEN_DISABLED to disable MySensors splash screen. (This saves 120 bytes of flash) #define MY_SPLASH_SCREEN_DISABLED //Define Sketch Name #define SKETCH_NAME "Blank Over The Air Node" //Define Sketch Version #define SKETCH_VERSION "0.001" // Enable and select radio type attached #define MY_RADIO_RF24 //Define this to use the IRQ pin of the RF24 module (optional). #define MY_RF24_IRQ_PIN 2 #define MY_RX_MESSAGE_BUFFER_FEATURE #define MY_RX_MESSAGE_BUFFER_SIZE 5 #define MY_RF24_PA_LEVEL RF24_PA_MIN //Default RF channel Default is 76 #define MY_RF24_CHANNEL 91 //PiHome Zone Controller Node ID #define MY_NODE_ID 1 //RF24_250KBPS for 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS for 2Mbps #define MY_RF24_DATARATE RF24_250KBPS //If Following LED Blink does not work then modify C:\Program Files (x86)\Arduino\libraries\MySensors_2_1_1\MyConfig.h #define MY_DEFAULT_ERR_LED_PIN 16 //A0 previous version 8 #define MY_DEFAULT_TX_LED_PIN 14 #define MY_DEFAULT_RX_LED_PIN 15 #define MY_WITH_LEDS_BLINKING_INVERSE #define MY_DEFAULT_LED_BLINK_PERIOD 400 #define MY_OTA_FIRMWARE_FEATURE #include <MySensors.h> void setup() { } void presentation() { //Send the sensor node sketch version information to the gateway sendSketchInfo(SKETCH_NAME, SKETCH_VERSION); } void loop() { }
Here is my boards.txt file just incase if i m missing something
########################################### MYS.name=OTA nRF Ch91 8MHz RF24_PA_MIN BOD-1.8v MYS.upload.tool=avrdude MYS.upload.protocol=arduino MYS.upload.maximum_size=30720 MYS.upload.speed=57600 MYS.bootloader.tool=avrdude MYS.bootloader.low_fuses=0xFF MYS.bootloader.high_fuses=0xDA # all the possible values: #MYS.extended_fuses=0x04 -> BOD at 4.3V #MYS.extended_fuses=0x05 -> BOD at 2.7V #MYS.extended_fuses=0x06 -> BOD at 1.8V #MYS.extended_fuses=0x07 -> BOD disabled MYS.bootloader.extended_fuses=0x06 MYS.bootloader.path=MYSBootloader MYS.bootloader.file=MYSBootloader.ch91.8000000L.RF24_PA_MIN.hex MYS.bootloader.unlock_bits=0x3F MYS.bootloader.lock_bits=0x0F MYS.build.mcu=atmega328p MYS.build.f_cpu=8000000L MYS.build.core=arduino MYS.build.variant=standard
serial console logs for node.
⸮Q)6 TSF:WUR:MS=0 12 TSM:INIT⸮2064 !TSM:FPAR:NO REPLY 2066 TSM:FPAR 2103 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: K,ID=0,D=1 4110`⸮⸮⸮255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1 4225 TSF:MSG:PONG RECV,HP=1 4229 TSM:UPL:⸮⸮⸮⸮⸮b⸮⸮⸮0,ft=0,st=OK:FFFFFFFFB803CFD40300 4247 TSF:MSG:S4442 TSF:MSG:READ,0-0-1,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 4460 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0 4706 TSF:MSG:READ,0-0-1,s=2⸮<sg=0,ft=0,st=OK:Blank Over The Air Node 4726 TSF:MSG:SE⸮SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 5001 TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1 5007 MCO:PIM:NODE⸮60993 TSF:MS⸮609826 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,p⸮702⸮702980 TSF:MSG:SEND,1-1-0-0,s=255,c=4⸮SG:SEND,1-1-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 703197 TSF:MSG:SEND,1-1-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1 ⸮P&⸮703457 OTA:FWP:UPDATE SKIPPED 703578 TSF:MSG:READ,0-0-1,s=255,c=3,t=6,pt=0,l=1,sg=0:M ⸮END,1-1-0-0,s=255,c=3,t=11,pt=0,l=23,sg=0,ft=0,st=OK:Blank Over The Air ⸮⸮⸮i⸮710047 OTA:FWP:UPDATE SKIPPED
screenshot of MYSController
-
RE: RFM69HCW with ESP8266 Gateway and relay module
@zboblamont
i was expecting bit more range with 2dbi antenna, you are right i have to put better antenna gateway.
are you referring to
MY_RFM69_TX_POWER_DBM in sketch? on same note
what would be different between MY_RFM69_MAX_POWER_LEVEL_DBM and TX_POWER, i have tried MY_RFM69_MAX_POWER_LEVEL_DBM to 100u but made no difference in range. -
RE: RFM69HCW with ESP8266 Gateway and relay module
@zboblamont, @mfalkvidd
Thank you both.Relay Node:
Powered by 5v and using MIC5205-3.3v voltage regulator. 10uf & 100nf cap on radio
Arduino 8Mhz with RFM69CHW at 433MhzDS18B20 Sensors:
Powered by 3xAAA battery and using MIC5205-3.3v voltage regulator. 10uf & 100nf cap on radio
Arduino 8Mhz with RFM69HW at 433MhzGateway:
Powered by 5v via micro USB to ESP.
ESP8266 with RFM69CHW at 433MhzFirst Test:
Gain:2dBi-3dBi
Wire diameter:0.6MM
Spring outer diameter:5MM
Total Length include soldering part: 34MM
Coil Turns: 28
Range around 20 to 30m while gateway was inside house.
Second Test
Gain:2dBi
Wire diameter:0.5MM
Spring outer diameter:5.5MM
Total Length include soldering part: unknown
Coil Turns: 17
Range around 20ish meter while gateway was inside house.
are there any customisations i can try in sketches to improve range? i.e max power level in sketch?
#define MY_RFM69_MAX_POWER_LEVEL_DBM 100u
-
RE: RFM69HCW with ESP8266 Gateway and relay module
adding following line to sketch fixed the reboot issues for me, but signal problem is still here
#define MY_RFM69_NEW_DRIVER```