Skip to content

Commit

Permalink
Changes for mos 2.15 (#8)
Browse files Browse the repository at this point in the history
* Changes to be 2.15 compliant
* OpenHAB has also changed

CL: sonoff-basic-openhab: Changes to be 2.15 compliant (Sergio R. Caprile <scaprile@gmail.com>)
  • Loading branch information
scaprile authored and rojer committed Sep 5, 2019
1 parent d9b2df2 commit 87f82ba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ mos --port "ws://${DEV_ADDR}/rpc" config-set \
```


### Setup at openHAB side
### Setup at openHAB side (valid only for pre 2.4 or 1.x binding)

If we use the locally installed mosquitto server, the MQTT broker can be configured as follows:

Expand Down
6 changes: 5 additions & 1 deletion mos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: openhab_sonoff_basic
author: Michael Fung <hkuser2001@gmail.com>
description: Sonoff Basic firmware to work with openHAB
version: 1.1_170818
skeleton_version: 2017-05-18
manifest_version: 2017-05-18

libs_version: ${mos_version}
modules_version: ${mos_version}
Expand Down Expand Up @@ -30,6 +30,10 @@ libs:
config_schema:
- ["mqtt.enable", true]
- ["mqtt.server", "hab2.lan:1883"]

platform: esp8266
build_vars:
# sonoff basic has 1MBytes flash only
FLASH_SIZE: 1048576
BOARD: esp8266-1M

15 changes: 7 additions & 8 deletions src/main.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#include <stdio.h>
#include <time.h>

#include "common/platform.h"
#include "common/cs_file.h"
#include "fw/src/mgos_app.h"
#include "fw/src/mgos_gpio.h"
#include "fw/src/mgos_sys_config.h"
#include "fw/src/mgos_timers.h"
#include "fw/src/mgos_hal.h"
#include "fw/src/mgos_dlsym.h"
#include "mgos.h"
#include "mgos_app.h"
#include "mgos_dlsym.h"
#include "mgos_gpio.h"
#include "mgos_hal.h"
#include "mgos_mqtt.h"
#include "mgos_sys_config.h"
#include "mgos_timers.h"
#include "mjs.h"

static int ON_BOARD_LED = 13; /* sonoff basic LED pin */
Expand Down

0 comments on commit 87f82ba

Please sign in to comment.