Colin Kuebler
153c8ed842
Start dnsmasq with command line options rather than a config file
...
No need to backup or restore dnsmasq.conf
Use wildcard to resolve all dns queries to 10.42.42.1
Write hostapd.conf locally so we don't need to backup/restore
Use sudo when writing NetworkManager.conf
Added and tweaked some log messages
Use pkill to stop hostapd so the cleanup portion of setup_ap is run
2019-09-26 12:47:39 -04:00
Colin Kuebler
bb39283d95
Do not imply that payload decryption failure is an issue, it is expected for .active endpoints
2019-09-25 16:56:44 -04:00
Colin Kuebler
ec453412de
Activation workaround by extending dummy schema - some devices crash if schema is shorter than expected
...
Added missing URLs in activation response
Readded .updatestatus to avoid .upgrade from catching this endpoint
Verify payload decryption is JSON
2019-09-25 10:25:40 -04:00
Colin Kuebler
97ecf0e305
Log SSL exceptions for debugging
2019-09-24 21:07:40 -04:00
Colin Kuebler
c0e57847a9
Fix variable rename missed
2019-09-23 16:39:31 -04:00
Colin Kuebler
ac19da4d83
Revert python to python3 as per discussion in #273
2019-09-23 16:36:20 -04:00
Colin Kuebler
5df7637452
Combined reply_encrypted in reply with encrypted flag
...
Tidying up by removing some redundant endpoints and adding comments
Now all but the activation endpoints use encryption when requested
2019-09-23 00:01:31 -04:00
Colin Kuebler
2a83af3d29
Set defaults for query params to prevent exceptions when missing
2019-09-22 18:50:24 -04:00
Colin Kuebler
a88db23ee4
Reorganized imports and made secKey configurable via command line option
2019-09-22 18:49:43 -04:00
Colin Kuebler
2104d47be5
Redirect GET requests to our POST handler
2019-09-22 18:29:02 -04:00
Colin Kuebler
da42236a1d
Implemented encrypted response support
...
Removed additional config.get payload, does not appear to be necessary and in some cases was causing problems
Revert upgrade type to 0 since we are trying to update the firmware on the main ESP82xx, not an external MCU
2019-09-22 18:25:30 -04:00
Colin Kuebler
27f1a33605
Enhance logging
...
Print request details, method, headers, and decrypted payload
Print response payload
2019-09-22 18:19:04 -04:00
Colin Kuebler
60c7ccbba7
Print out PSK identity for debugging purposes
2019-09-22 18:13:14 -04:00
Colin Kuebler
769901a673
Added endpoint for /d.json based on reports in #273
2019-09-21 18:32:47 -04:00
Colin Kuebler
5fe523aafe
Merge branch 'master' into new-api
...
Attempted to integrate new API responses with old ones, based on et=1 param
**Untested**
2019-09-21 18:27:31 -04:00
Colin Kuebler
2039394c17
Pass the protocol version from trigger_upgrade to mq_pub_15
2019-09-21 17:34:52 -04:00
Colin Kuebler
5114b1ef7d
Merge branch 'master' into fix-net-inf
2019-09-21 17:28:55 -04:00
Colin Kuebler
41ac947ce7
Readded old protocol 2.1 encoding back into mq_pub_15
...
Added optional argument "--protocol" which specifies whether to use the old or new MQTT encoding
Cleaned up a bit, adding some descriptive variable names and reducing code clutter
2019-09-21 17:08:46 -04:00
Colin Kuebler
8291ced3da
Tidy PSK generation, only define PSK hint in one location
2019-09-21 16:04:10 -04:00
Madmartigan
ea815b7d62
fix: gwId was not parsed
2019-09-19 08:33:28 +02:00
Madmartigan
7d588cda4e
Circumvent new tuya sdk protection
2019-09-18 21:38:11 +02:00
Colin Kuebler
f345e1843d
Only print out smart config parameters once
2019-08-07 13:52:47 -04:00
Colin Kuebler
22bdbb5629
Exit server cleanly on SIGINT (^C) to reduce error message noise
2019-07-04 19:54:12 -04:00
Colin Kuebler
d754802f35
Added auto-retry to smartconfig, make 10 attempts before exiting
2019-07-04 19:26:25 -04:00
Colin Kuebler
da1966ac42
Bugfixes; file_md5 was type bytes vs str, reply() needed argument default, use get_argument() instead of request.arguments[], json to str lambda to ease schema encoding, true => True in python
2019-07-03 14:02:33 -04:00
Colin Kuebler
54af5ebba8
Check for wpa_supplicant #19 #84 #172 #208 and many more
2019-07-02 15:31:37 -04:00
Colin Kuebler
39954071bd
Added API response for s.gw.upgrade.updatestatus
2019-07-02 15:23:23 -04:00
Colin Kuebler
39b9bcd768
Added API methods: .device.upgrade .timer and .config
...
tuya.device.upgrade.get and tuya.device.upgrade.silent.get should allow upgrades on devices where s.gw.upgrade is not called
2019-07-02 14:48:36 -04:00
Colin Kuebler
beab732cfe
Implemented JSONHandler.reply to reduce code repetition
...
Adds timestamp, serializes response, and applies appropriate headers
Fetch gwId and a from query parameters instead of manual uri parsing
Represent API responses as dict objects for clarity and flexibility
Compute upgrade.bin md5 and file size only once when the server is started
2019-07-02 14:43:24 -04:00
Colin Kuebler
d11f94f45d
Backup hostapd config #61
...
Do not overwrite config backups #61
2019-07-02 14:30:09 -04:00
Colin Kuebler
9c8db5752c
Added a check to ensure that the configured network interface exists
2019-07-02 14:22:25 -04:00
Colin Kuebler
48bdc072ed
Added config for mosquitto so it only binds to 10.42.42.1
...
Now that there is no conflict for ports, we do not have to stop apache or mosquitto before starting our own
2019-07-02 14:18:03 -04:00
Colin Kuebler
0e7c1f080c
Modify dnsmasq config to only bind to 10.42.42.1 as suggested in #187
2019-07-02 14:13:04 -04:00
Colin Kuebler
fcbb35019b
Added option for specifying the server bind addr, defaulting to 10.42.42.1
...
Catch bind error and produce a helpful message if port is unavailable
This should make it possible to run the server without interfering with 0.0.0.0:80
2019-07-02 14:00:18 -04:00
Colin Kuebler
2309e03e74
Merge branch 'master' into smart-link-py
2019-03-23 11:37:37 -04:00
Colin Kuebler
780e62d99f
Updated references to upgrade.bin
...
Simplify schema to lowest common denominator
2019-03-22 17:32:08 -04:00
Colin Kuebler
ce49a76f24
Removed old backup script and replaced with curl from new intermediate firmware backup endpoint
2019-03-22 17:09:26 -04:00
Colin Kuebler
40c0c026a7
Default bind address to our fake AP
2019-03-22 16:54:01 -04:00
Colin Kuebler
6f625371a8
Merge branch 'master' into smart-link-py
2019-01-28 12:04:45 -05:00
Colin Kuebler
aa51be827e
Missed file permission commit; mark main.py executable
2019-01-27 15:52:29 -05:00
Michael Behrisch
aa4b4ecf34
Update setup_ap.sh
2019-01-27 18:18:27 +01:00
Colin Kuebler
379b26ffd7
Wrote Python 3 implementation of smartconfig
...
Includes broadcast strategy ported from tuyapi/link
Also includes multicast strategy not yet employed in tuyapi/link
Removed JS script and updated start_flash script to reflect changes
2019-01-26 18:25:16 -05:00
ms_vtrust
927e5c448a
Update fake-registration-server.py
2019-01-22 16:05:54 +01:00
Merlin Schumacher
cb650aa379
Remove useless json file & updated gitignore
2019-01-21 17:46:23 +00:00
Merlin Schumacher
244896a816
Fixes for Python 3
2019-01-21 17:44:00 +00:00
Merlin Schumacher
080a4cb574
Unify python3 usage
2019-01-21 16:42:10 +00:00
Andrijan Möcker
ee8753086e
Change to Python 3
2019-01-17 15:35:25 +01:00
Merlin Schumacher
f443485a6a
Initial Commit
2019-01-16 20:32:16 +01:00