Giter Site home page Giter Site logo

homie-ota's Introduction

homie-ota

This is a small OTA (Over the Air) "server" for the excellent Homie-ESP8266 framework for ESP8266 modules. In addition to providing OTA over HTTP/HTTPS, homie-ota also provides device inventory and firmware management with an explicitly retro-style Web interface (the KISS layout reminds us of the fact we're dealing with $4 IoT devices ...)

homie-ota

homie-ota contains a built-in HTTP server powered by Bottle; this is the bit that a Homie device talks to in order to obtain OTA firmware. On the other hand, homie-ota connects to your MQTT broker in order to obtain an inventory of Homie devices (current status ($online), firmware ($fwname) and firmware version ($fwversion), device name ($name), etc. These values are collected by homie-ota and stored in a JSON data structure in the file system.

Features

  • OTA firmware server for Homie devices.
  • Upload new firmware to the firmware store.
  • Trigger OTA firmware update by MQTT publish to a Homie device
  • Logging
  • View device details and sensor readings

Firmwares

Firmware files are uploaded into homie-ota via its Web interface, and they must contain the magic tokens in order for homie-ota to correctly process them. (See below for how to create those.) All firmware files are stored in the OTA_FIRMWARE_ROOT directory as <name>-<version>.bin, with name being the name of the firmware and version it's semantic version number (e.g. dual-relay-1.0.5). In addition, an optional description you enter is stored as <name>-<version>.txt.

homie-ota makes it easy to deploy a different firmware onto an ESP8266 device: simply select the firmware you want on the device and queue the OTA request. As per the Homie Convention, this request is published over MQTT, however note that homie-ota does not currently publish this message retained which means, that if the device is currently not online, it will miss an update. (This is by design to avoid OTA loops.)

Due to sensible limitations in Homie, the string containing the concatenation of firmware name and version may not be longer than 16 characters. In order for you to be able to name your firmware however you'd like to, what homie-ota does is to hash the name when triggering an OTA request to a device. As such, if you're watching a serial console, or the publish going via your MQTT broker, you'll see something like this:

devices/0fbbe2e0/$ota [email protected]

OTA available (version [email protected])

NOTE: homie-ota also supports external OTA update requests, as per the Homie Convention, which can be manually triggered by publishing the new version to the /$ota topic of a device. The payload should just be the version number in the format x.x.x. This only allows upgrades to the currently installed firmware, i.e. you cannot swap out the firmware as you can by scheduling an OTA update through homie-ota.

Installation

Obtain homie-ota and its requirements. Copy the exmple configuration file to homie-ota.ini and adjust, creating the OTA_FIRMWARE_ROOT firmware directory if it doesn't yet exist.

Launch homie-ota.py.

Configure your Homie devices to actually use homie-ota by providing the appropriate settings in their configuration:

Homie config

ESP8266 Arduino

For a complete setup (incl. autostart) check out the installation guide with step-by-step instructions.

Preparing the firmware

In order to use the Autodetectable Binary Upload™, your Homie sketch should contain a magic expression in it as shown in the example sketch. When you're ready, compile the binary. To upload it: under the Sketch menu in the Arduino IDE, select Export compiled Binary; the binary .bin will be placed in the sketch's directory, and you upload that file to homie-ota; it will detect the firmware name and version, store it into the correct directory, and make it available in the list of upgradable firmware files.

You can upload the file directly to homie-ota from the command-line using curl, say:

$ curl -F [email protected]_mini.bin \
       -F description="D1-mini with homie-1.4.1" \
       http://homie-ota.example.org:9080/upload

Firmware from lt.ino.d1_mini.bin uploaded as /path/to/firmwares/lt-2.0.0.bin

If basic http authentication is enabled, add "-u username:password" to the curl command

We do this directly from the sketch directory into which the exported binary was written.

homie-ota's People

Contributors

amayii0 avatar einstweilenhier avatar fvdpol avatar gulaschcowboy avatar halo779 avatar jalmeroth avatar jpmens avatar keesma avatar linhdnguyen avatar mrpace2 avatar nos86 avatar snikch avatar sumnerboy12 avatar thorhs avatar toke avatar unimatrix099 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homie-ota's Issues

unexpected behaviour/errors

Was working well until I upgraded Beaglebone Black Debian image to latest and reinstalled Mosquitto and homie-ota. (see 1st screenshot below)

It was a long time ago I installed this originally (using up to homie v2.0) - should it all still work? Likely I've done something daft! python -V gives me Python 2.7.13

There's an erroneous 'b' appearing all over the place. I've done a bit of hunting around based on the errors produced but haven't fixed/found the concrete issue.

Seeing some errors when stopping the service.. (see code below)
AND
Another error when attempting a firmware upload.. (see 2nd screenshot below)

Thanks Rob

`May 23 20:07:15 beaglebone python[3059]: File "/usr/lib/python3.5/json/encoder.py", line 403, in _iterencode_dict

May 23 20:07:15 beaglebone python[3059]: yield from chunks

May 23 20:07:15 beaglebone python[3059]: File "/usr/lib/python3.5/json/encoder.py", line 403, in _iterencode_dict

May 23 20:07:15 beaglebone python[3059]: yield from chunks

May 23 20:07:15 beaglebone python[3059]: File "/usr/lib/python3.5/json/encoder.py", line 436, in _iterencode

May 23 20:07:15 beaglebone python[3059]: o = _default(o)

May 23 20:07:15 beaglebone python[3059]: File "/usr/lib/python3.5/json/encoder.py", line 179, in default

May 23 20:07:15 beaglebone python[3059]: raise TypeError(repr(o) + " is not JSON serializable")

May 23 20:07:15 beaglebone python[3059]: TypeError: b'c' is not JSON serializable
`

image

And

image

Homie 2.0: wrong version published to $ota

homie-ota publishes a string like [email protected] to the $ota topic. Mosquitto log:

homie/my-device/$implementation/payload <firmware blob>
homie/my-device/$ota [email protected]

However, Homie 2.0 wants just the new firmware version number (1.0.0) to be published to the device/$ota topic.

As a result, homie-esp8266 (2.0 branch) always updates firmware, even if the new firmware version number equals the currently running firmware version.

MQTT topic for OTA on Homie 2.0 devices is incorrect

Updating Homie 2.0 devices with homie-ota fails. This is because homie-ota does not adhere to the update procedure as specified in http://marvinroger.github.io/homie-esp8266/docs/2.0.0-beta.3/others/ota-configuration-updates/

Currently, homie-ota publishes:

Topic Payload
<basetopic>/<deviceid>/$implementation/ota/checksum <checksum>
<basetopic>/<deviceid>/$implementation/ota/firmware <firmware>

when it must publish:

Topic Payload
<basetopic>/<deviceid>/$implementation/ota/<checksum> <firmware>

I tested this change against homie-esp8266 v2.0.0-beta.3

ota failed

I am having problem getting devices to update. Using the latest homie-ota in both log and console not seeing any kind of issue and firmware parser gives output.

I have tried both homie 1.5 and 2. 1.5 goes through the process and starts a ota but gives a update failed. I do not know where I can get additional information on this as to why it failed.

in homie 2.0(master I dont see a actual release) it starts a update process but then gives a stack dump with something about error 3. Iknow there is probab;y somewhere else I can find more infomation to diagnose this I just dont know where.

Thanks

✖ Update failed

Hi,

I am trying to install updates on my ESP8266 ESP-01E Over-the-Air but it always fails like this:

homie-ota log file

2016-04-27 23:40:05,862 INFO Starting homie-ota
2016-04-27 23:40:05,862 INFO INFO MODE
2016-04-27 23:40:05,863 DEBUG DEBUG MODE
2016-04-27 23:40:05,863 DEBUG INIFILE = homie-ota.ini
2016-04-27 23:40:05,865 DEBUG Attempting connection to MQTT broker at localhost:1883...
2016-04-27 23:40:05,907 DEBUG devices/13c8f3e0/$online (qos=0, r=1) true
2016-04-27 23:40:05,907 DEBUG devices/13c8f3e0/$nodes (qos=0, r=1) light:switch
2016-04-27 23:40:05,907 DEBUG devices/13c8f3e0/$name (qos=0, r=1) ESP8266
2016-04-27 23:40:05,907 DEBUG devices/13c8f3e0/$localip (qos=0, r=1) 192.168.178.37
2016-04-27 23:40:05,907 DEBUG devices/13c8f3e0/$fwname (qos=0, r=1) test-firmware
2016-04-27 23:40:05,907 DEBUG devices/13c8f3e0/$fwversion (qos=0, r=1) 1.0.0
2016-04-27 23:40:05,908 DEBUG devices/13c8f3e0/$signal (qos=0, r=1) 56
2016-04-27 23:40:05,908 DEBUG devices/13c8f3e0/$uptime (qos=0, r=1) 5
2016-04-27 23:40:18,600 INFO OTA request sent to device 13c8f3e0 for update to [email protected]
2016-04-27 23:40:18,601 DEBUG devices/13c8f3e0/$ota (qos=0, r=0) [email protected]
2016-04-27 23:40:23,976 DEBUG X-Esp8266-Ap-Mac = 5E:CF:7F:13:C8:F3
2016-04-27 23:40:23,976 DEBUG Content-Length =
2016-04-27 23:40:23,976 DEBUG X-Esp8266-Free-Space = 77824
2016-04-27 23:40:23,976 DEBUG X-Esp8266-Chip-Size = 1048576
2016-04-27 23:40:23,976 DEBUG X-Esp8266-Sdk-Version = 1.5.2(7eee54f4)
2016-04-27 23:40:23,976 DEBUG Host = 192.168.178.34
2016-04-27 23:40:23,976 DEBUG X-Esp8266-Sketch-Size = 359132
2016-04-27 23:40:23,976 DEBUG X-Esp8266-Sta-Mac = 5C:CF:7F:13:C8:F3
2016-04-27 23:40:23,976 DEBUG User-Agent = ESP8266-http-Update
2016-04-27 23:40:23,976 DEBUG Connection = close
2016-04-27 23:40:23,976 DEBUG X-Esp8266-Mode = sketch
2016-04-27 23:40:23,976 DEBUG X-Esp8266-Version = [email protected]
2016-04-27 23:40:23,976 DEBUG Content-Type = text/plain
2016-04-27 23:40:23,976 INFO Homie firmware=test-firmware, have=1.0.0, [email protected] on device=13c8f3e0
2016-04-27 23:40:23,977 INFO Returning OTA firmware ./firmwares/test-firmware-1.0.1.bin
2016-04-27 23:40:29,284 DEBUG devices/13c8f3e0/$online (qos=0, r=0) true
2016-04-27 23:40:29,328 DEBUG devices/13c8f3e0/$nodes (qos=0, r=0) light:switch
2016-04-27 23:40:29,331 DEBUG devices/13c8f3e0/$name (qos=0, r=0) ESP8266
2016-04-27 23:40:29,335 DEBUG devices/13c8f3e0/$localip (qos=0, r=0) 192.168.178.37
2016-04-27 23:40:29,338 DEBUG devices/13c8f3e0/$fwname (qos=0, r=0) test-firmware
2016-04-27 23:40:29,342 DEBUG devices/13c8f3e0/$fwversion (qos=0, r=0) 1.0.0
2016-04-27 23:40:29,389 DEBUG devices/13c8f3e0/$signal (qos=0, r=0) 60
2016-04-27 23:40:29,391 DEBUG devices/13c8f3e0/$uptime (qos=0, r=0) 5

homie-ota output on console

192.168.178.21 - - [27/Apr/2016 23:40:18] "POST /update HTTP/1.1" 200 69
192.168.178.37 - - [27/Apr/2016 23:40:30] "GET /ota HTTP/1.0" 200 49152
Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
self.finish_response()
File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response
self.write(data)
File "/usr/lib/python2.7/wsgiref/handlers.py", line 217, in write
self._write(data)
File "/usr/lib/python2.7/socket.py", line 324, in write
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
192.168.178.37 - - [27/Apr/2016 23:40:30] "GET /ota HTTP/1.0" 500 59


Exception happened during processing of request from ('192.168.178.37', 17833)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 657, in init
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 716, in finish
self.wfile.close()
File "/usr/lib/python2.7/socket.py", line 279, in close
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe


Serial Monitor Arduino

✴ OTA available (version [email protected])
Flagged for OTA
Device is in a resettable state
↻ Rebooting into OTA mode...

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
csum 0x0f
~ld

Triggering HOMIE_OTA_MODE event...
** Booting into OTA mode **
↕ Connecting to Wi-Fi (attempt 2/3)
✔ Connected to Wi-Fi
Starting OTA...
✖ Update failed
↻ Rebooting into normal mode...

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
csum 0x0f
~ld

Triggering HOMIE_NORMAL_MODE event...
** Booting into normal mode **

Is there anything I can do about it?

Thanks for your help and this great peace of software!

reset option in device page

Hi, can you add reset option in device.tpl?

Homie implements reset option to delete all configuration for a device:

https://homieiot.github.io/homie-esp8266/docs/develop-v3/others/homie-implementation-specifics/

$implementation/reset: You can publish a true to this topic to reset the device

Thank you!!!

PD: I have implemented it, here is the code:

homie-ota.py:

# Handle deleting a device from the mqtt broker, and the local db.
@route('/device/<device_id>', method='PATCH')
@conditional_decorator('HTTP_USER' in globals() and 'HTTP_PASSWORD' in globals(), auth_basic(check))
def reset_device(device_id):
    topic = "%s/%s/$implementation/reset" % (MQTT_SENSOR_PREFIX, device_id)
    mqttc.publish(topic, payload='true', qos=1, retain=False)
    logging.debug("Reset device: {}".format(device_id))
	
    info = "reset configuration for %s" % (device_id)
    logging.info(info)
	
    del db[device_id]
    del sensors[device_id]

    return info

device.tpl

... [<a class="reset" data-reset-url="{{base_url}}/device/{{device}}" href="#">Reset</a>] ..
$('.reset').bind('click', function (e){
  e.preventDefault();
  if (confirm("Are you sure to reset this device?")) {
    $.ajax({
      url: $(this).data('reset-url'),
      type: 'PATCH',
      async: true
    })
    .done(function() {
      alert('Reseted device');
      window.location.href = '{{base_url}}/';
    })
    .fail(function(e) {
      alert('Error: ' + e.statusText);
    })
  }
  return false;
})`

PR #77 breaks Inventory display for Homie 2.0.1 devices

PR #77 breaks compatibility with the Homie 2.0.1 devices (which is still the latest 'official' released version for ESP8266 devices).

The inventory page does not show Online, Signal, IP, Uptime for Homie 2.0.1 devices anymore

with original templates/inventory.tpl:
image

with the new/updated templates/inventory.tpl:
image

Homie v2 compatible?

First of all, a lot of thanks for your work it's really nice and useful tool.

My question is really simple, is that compatible with Homie 2.0 convetion 2.0?

Thanks a lot, I appreciate your work very much.

Regards.
Oriol Rius

ota update with fw_name `wemos-dht22` ignored (but `wemos-dht` works)

uploaded firmware with fw_name wemos-dht22 and fw_version 0.0.1 - tried over a dozen times to two different Wemos devices. The OTA update request is just ignored. I.e. the pub is made by homie-ota to /$ota but the device never restarts in config mode.

changing fw_name to wemos-dht and the OTA update was picked up first time.

might be a Homie issue?

OTA for Homie 1.5 broken in spite of supposed fix

First of all, thanks for the great tool!

It appears that e047121 intends to enable backwards compatibility for Home 1.5 devices using the old multiple '=' convention.

However, when trying to update the firmware on a Home 1.5 device with the Homie version in platform.io (which I think is 1.5), the OTA request fails with

File "./homie-ota.py", line 410, in ota
    device, f = headers.get('X-Esp8266-Version', None).split('=')
ValueError: too many values to unpack

My weak python-foo tells me that homie-ota is actually expecting a 2.0-style header with the '->' convention.

Can't get homie-ota.py to run (Debian or Ubuntu). Fails missing global section?

With some mangling I was able to get Homie-OTA to work on a Raspberry Pi Zero W, but now I'm trying to set it up in a more permanent fashion on a Ubuntu 16.04 VM (Proxmox KVM) or on Debian 8. I'm failing, but not sure why. I'm not an experienced user of either Ubuntu or Debian, so I could easily be missing something obvious.

I've following the install instructions, but I can't get homie-ota.py to run manually. As best I can tell, this is where it's failing:

Traceback (most recent call last):
  File "/root/homie-ota/homie-ota.py", line 39, in <module>
    DEBUG = config.getboolean("global", "DEBUG")
  File "/usr/lib/python2.7/ConfigParser.py", line 368, in getboolean
    v = self.get(section, option)
  File "/usr/lib/python2.7/ConfigParser.py", line 330, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'global'

Does that make sense? Is there something else I need to do on either a Ubuntu or Debian VM? Both seemed to fail at the same spot. Not sure why an RPi would work, but these would not.

I really like the project! This is a great addition to Homie - makes updates and monitoring of units extremely easy. Thank you!

Error in startup of homie-ota.py: on_connection() takes 3 arguments, 4 given

Trying to run Homie-OTA, I get the following error trying to run homie-ota.py. I have edited the homie-ota.ini file to remove the username/password to connect to MQTT since I'm not using any authN, but otherwise made no changes. Appears to be a bug somewhere in calling the Paho MQTT client?


Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/pi/.venvs/homie-ota/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2606, in _thread_main
    self.loop_forever(retry_first_connection=True)
  File "/home/pi/.venvs/homie-ota/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1470, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/home/pi/.venvs/homie-ota/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 995, in loop
    rc = self.loop_read(max_packets)
  File "/home/pi/.venvs/homie-ota/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1273, in loop_read
    rc = self._packet_read()
  File "/home/pi/.venvs/homie-ota/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1838, in _packet_read
    rc = self._packet_handle()
  File "/home/pi/.venvs/homie-ota/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2291, in _packet_handle
    return self._handle_connack()
  File "/home/pi/.venvs/homie-ota/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2349, in _handle_connack
    self.on_connect(self, self._userdata, flags_dict, result)
TypeError: on_connect() takes exactly 3 arguments (4 given)

DB not synced to disk

Not sure if this has something to do with my environment only, but I was able to fix this by modifying the code a bit (see below).
Issue is that if I delete a node it disappears from the GUI, but re-appears next time homie-ota is started. This happens even if I manually stop and re-start the service. I run it without virtualenv with separate user using systemd on RPi2 and raspbian jessie. Homie-ota latest from git.

Quick check made me feel the exit function to sync db to disk is never called (so it always restores the old data from disk on startup). I added a print there and yes, it is not called in my RPi when doing systemctl stop (SIGTERM). I'm really not a python person, but the following simple workaround made it work for me:

ota-diff.patch.txt

Auto detection of firmware name and version

It would be useful to be able to detect the firmware name and version when uploading a firmware, instead of having to put the information manually.

This would require some changes to the sketches to be compatible, here is a POC:

sketch.ino

#include <Homie.h>

#define FW_NAME "test-firmware"
#define FW_VERSION "1.2.3"

#define FLAGGED_FW_NAME "\xbf\x84\xe4\x13\x54" FW_NAME "\x93\x44\x6b\xa7\x75"
#define FLAGGED_FW_VERSION "\x6a\x3f\x3e\x0e\xe1" FW_VERSION "\xb0\x30\x48\xd4\x1a"

void setup() {
  Homie.setFirmware(FLAGGED_FW_NAME, FLAGGED_FW_VERSION);
  Homie.setup();
}

void loop() {
  Homie.loop();
}

parser.py

import re

regex_name = re.compile(b"\xbf\x84\xe4\x13\x54(.+)\x93\x44\x6b\xa7\x75")
regex_version = re.compile(b"\x6a\x3f\x3e\x0e\xe1(.+)\xb0\x30\x48\xd4\x1a")
firmware_file = open("./sketch.ino.nodemcu.bin", "rb")
firmware_binary = firmware_file.read()
firmware_file.close()

regex_name_result = regex_name.search(firmware_binary)
regex_version_result = regex_version.search(firmware_binary)

if not regex_name_result or not regex_version_result:
  print("Not a valid firmware")
  exit(1)

print("Name: " + regex_name_result.group(1))
print("Version: " + regex_version_result.group(1))

This would be a valuable addition;

Great project, by the way! 😄

Provide non-rpi Dockerfile

Hi,
A normal alpine linux dockerhib repo would be great, to allow those of us without rpis to install directly without altering the dockerfile.

Homie v2 support

There are some changes to MQTT API.
Can you share your thoughts - how about supporting homie v2?

Homie OTA is not working

I just upgraded to Homie ESP8266 to latest updates (07-July) and the Homie-OTA stopped working. I tried to debug the issue but couldn't find the exact issue. Before upgrading Homie-ESP8266 and Homie-OTA, the upgrading ESP8266 via Homie-OTA used to work.

Has anybody has the problem.
Let me know thanks.

Connection reset by peer after pressing schedule button

I always got this problem everytime I tried update OTA

lesjaw@cloud:~/homie-ota$ ./homie-ota.py
Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://103.43.47.61:9080/
Hit Ctrl-C to quit.

202.62.17.11 - - [21/Aug/2017 22:11:25] "GET / HTTP/1.1" 200 20054
202.62.17.11 - - [21/Aug/2017 22:11:25] "GET /jquery.pBar.min.js HTTP/1.1" 304 0
202.62.17.11 - - [21/Aug/2017 22:11:25] "GET /styles.css HTTP/1.1" 304 0
202.62.17.11 - - [21/Aug/2017 22:11:25] "GET /jquery.min.js HTTP/1.1" 304 0
202.62.17.11 - - [21/Aug/2017 22:11:26] "GET /false.png HTTP/1.1" 304 0
202.62.17.11 - - [21/Aug/2017 22:11:26] "GET /true.png HTTP/1.1" 304 0
202.62.17.11 - - [21/Aug/2017 22:11:37] "POST /update HTTP/1.1" 200 75
[Errno 104] Connection reset by peer
[Errno 104] Connection reset by peer
[Errno 104] Connection reset by peer
[Errno 104] Connection reset by peer
[Errno 104] Connection reset by peer
[Errno 104] Connection reset by peer
[Errno 104] Connection reset by peer
[Errno 104] Connection reset by peer
[Errno 104] Connection reset by peer

Update not working - leading to crashed ESP8266

I'm running homie-ota on a windows PC.

As I tried updating one node via homie-ota i saw two interesting things today:

  1. Upload worked, but the uploaded firmware is too short (mqtt messages say approx. 8000 bytes, image is 408000 bytes big ) - leading to a crashed esp8266 node. The size of the image file is shown correctly when browsed via homie-ota web UI

  2. Upload did not work with node responding an Internal error (ota status 500).

I saw, that the calculated checksum (the target topic homie-ota is trying to publish to) is wrong - maybe this is the root cause of my problems?!?

Could this be something in relation to my Windows environment?

V2 (beta) homie - device not registering

I've just been playing with homie, and to that end installed homie-ota.
The server is up and running and I connect to it with a browser.

I had the understanding that running device would show up in the site. Is that correct?

App running on Python3.4

I'm running this application using python 3.4 on Windows, and I'm receiving warning because MQTT reading is byte based instead string (as expected).
I'm doing something wrong, or we need to improve the code?

Logging to specified path - included code.

Hey I had a quick 4 line update I think might be worthy of inclusion next time you update.

try:
    LOGFILE = os.path.join(os.path.sep,config.get("global","LOG_PATH"), APPNAME + '.log')
except Exception as e:
    print "logging set error: " + str(e)

and put a new config item in the homie-ota.ini of LOG_PATH in the config, so that it can be set (else it will default to the current path).

Changing configuration file requires clean install

After I change configuration file "homie-ota.ini" (I changed property: MQTT_SENSOR_PREFIX) the homie-ota will not start, throwing errors. The only way to get it working is to remove the whole folder and copy a clean one.

auto-refresh pages

maybe every 60s so you can leave the window open and see a semi-realtime view of your devices

PR #67 for 2 issues

Hi @jpmens, I filed a PR for 2 issues:

  • correcting import of ConfigParser as configparser
  • adaptation to the latest homie convention regarding OTA topic

Hope you can merge them as is.

Thanks and regards,
Alex

Check if devices that match device topic are homie devices

I've got a mix of homie and non-homie based devices who all publish to the same topic.
All devices show up in the device overview of homie-ota, but the non-homie based devices are shown offline (of course) and can not be updated with different firmware (of course again.)

Is it possible to be more selective and only show devices that publish to one or more sub-topics that are specific to homie devices?

OTA on EST-01

Hi,
When I do the OTA to an ESP-01 the process starts but then fails/stops. Is this because ESP-01 only has 1MB of memory?

Thank you,
Mike

homie-ota not running in docker

I am trying to run homie-ota in docker (RancherOS v1.1.0 (4.9.45).
After starting it I get the error message below.
I am fairly new to docker. Not sure if it is related to docker or e.g the commandline parameters.
On the internet i cannot find similar issues nor solutions.
Who can help me fix this?

6-1-2018 10:32:08Traceback (most recent call last): 6-1-2018 10:32:08 File "homie-ota.py", line 40, in <module> 6-1-2018 10:32:08 DEBUG = config.getboolean("global", "DEBUG") 6-1-2018 10:32:08 File "/usr/lib/python2.7/ConfigParser.py", line 368, in getboolean 6-1-2018 10:32:08 v = self.get(section, option) 6-1-2018 10:32:08 File "/usr/lib/python2.7/ConfigParser.py", line 330, in get 6-1-2018 10:32:08 raise NoSectionError(section) 6-1-2018 10:32:08ConfigParser.NoSectionError: No section: 'global'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.