You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a description to setup with wget instead of sonoff.setupdevice.js
This helps to make it run on an respberry pi without installing the network manager.
(thanks to @andrewerrington for the description)
@@ -14,11 +13,12 @@ Change the sonoff.config.json to fit your environment.
14
13
15
14
The "server" is the device, which should stay in contact with the SONOFF devices. In my case it was the Raspverry Pi, which also runs Openhab.
16
15
17
-
"httpsPort" can be any port.
18
-
"websocketPort" can be any port.
16
+
* "httpsPort" can be any port.
17
+
* "websocketPort" can be any port.
18
+
19
19
But make sure, that your router is allowing communication between devices.
20
20
21
-
```javascript
21
+
```json
22
22
{
23
23
"router": {
24
24
"SSID": "#############",
@@ -34,13 +34,28 @@ But make sure, that your router is allowing communication between devices.
34
34
```
35
35
36
36
# Setup a new device
37
+
There are two ways of setting up the devices. Either with the sonoff.setupdevice.js script, or with wget (or anything else that can post an http request to a specific server).
38
+
39
+
### sonoff.setupdevice.js
37
40
Start sonoff.setupdevice.js on a computer you like. It will connect to the SONOFF device, so you will lose internet connection. When the scripts runs, you must long-click the black button on the device, and it will be configured to use the "server" as its cloud. Which now runs in your own network.
38
41
42
+
To run this on a linux device, the network manager must be installed. On an raspberry pi I would suggest to do the setup process manually with wget.
43
+
44
+
### wget
45
+
(thanks @andrewerrington)
46
+
1. Put the SonOff/Wemos device in AP mode (press and hold button for 5s)
47
+
1. Find the device and connect to it (SSID: ITEAD-10000xxxxx Password: 12345678)
1. (optional) use wget to read device info `wget -O- 10.10.7.1/device`
50
+
1. use wget to send local WiFi settings to device `wget -O- --post-data='{"version":4,"ssid":"yourSSID","password":"yourSSID_PASSWORD","serverName":"n.n.n.n","port":1080}' --header=Content-Type:application/json "http://10.10.7.1/ap"`
51
+
52
+
The device will automatically drop out of AP mode and tries to connect to WiFi and server.
53
+
39
54
# running the server
40
55
Start sonoff.server.js
41
56
This Server keeps the connection to the sonoff devices, and must run permanently.
42
57
43
-
> /devices => list off all devices that are currently known to the server.
44
-
> /devices/:deviceId => shows the status of the device
45
-
> /devices/:deviceId/on => turns the device "on"
46
-
> /devices/:deviceId/off => turns the device "on"
58
+
* /devices => list off all devices that are currently known to the server.
59
+
* /devices/:deviceId => shows the status of the device
0 commit comments