-
Notifications
You must be signed in to change notification settings - Fork 20
Complete rewrite to make adding features and fixes easier #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
bytespider
wants to merge
42
commits into
develop
Choose a base branch
from
feature/rewrite
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
de3b10e
rewrite as ESM
bytespider 631e46b
WIP
bytespider 244295a
added missing files
bytespider 5f5d2d9
componentise the library
bytespider 827ad31
keep code clean
bytespider 9b1de7f
format to standard
bytespider cfaed31
Remove unneeded imports
bytespider bb94969
Remove debuging
bytespider 3ff072d
Use `configure` rather then `set` to imply action over the network
bytespider a30ab90
rename functions and document
bytespider eb2e609
updated deps
bytespider ec2eb55
Proof read options
bytespider 0ba0811
Update readme
bytespider 881381b
Update readme
bytespider faeaba1
Update readme with requirements
bytespider c2f3c89
removed old api file
bytespider 0c42ba1
updated github action
bytespider 3a95cb6
updated version
bytespider e276c8b
update versions
bytespider a4020c6
update to use import attributes rather than import assertions
bytespider b4ccfb3
add docker test environment
bytespider bf0d3d5
remove parameters from shebang
bytespider 8938f93
clean up ignore files
bytespider eb4fa81
remove VERSION file
bytespider cf1c3d7
add license
bytespider 920d5ac
complete typescript rewrite. Added encrypted communication for device…
bytespider 43bea72
removed dist
bytespider e0e65a9
added dist to ignore
bytespider b6a5e23
allow strings to be passed to base64 encode
bytespider 011d83b
decide the protocol and the port based on the input
bytespider b2bc8c0
use strings not buffers
bytespider 1a315a5
remove commented reference code
bytespider a4244bd
added readme and license
bytespider a65d52b
ip flag is not required as we default it
bytespider bfd5d05
fix license
bytespider 29862da
for build and publishing
bytespider 4e67458
for build and publishing
bytespider ba2a46f
fix packages
bytespider 97bb1d4
make sure node std libraries are imported with node: prefix
bytespider 3e0a7c8
2.0.0
bytespider e94d6d8
WIP
bytespider 179521d
update version
bytespider File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
bin/src/node_modules | ||
cmd/ | ||
dumps/ | ||
old_certs/ | ||
# Directories | ||
node_modules/ | ||
dist/ | ||
|
||
# Files | ||
*.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Directories | ||
certs/ | ||
cmd/ | ||
dumps/ | ||
mosquito/ | ||
old_certs/ | ||
teardown/ | ||
|
||
#Files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"arrowParens": "always", | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"useTabs": false | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["esbenp.prettier-vscode"] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.detectIndentation": false, | ||
"editor.tabSize": 2 | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM eclipse-mosquitto:1.6.15-openssl | ||
|
||
COPY mosquitto/basic.conf ./mosquitto/config/mosquitto.conf | ||
RUN apk add --update --no-cache openssl && \ | ||
mkdir /mosquitto/config/certs && \ | ||
cd /mosquitto/config/certs && \ | ||
openssl genrsa -out ca.key 2048 && \ | ||
openssl req -x509 -new -nodes -key ca.key -days 3650 -out ca.crt -subj '/CN=My Root' && \ | ||
openssl req -new -nodes -out server.csr -newkey rsa:2048 -keyout server.key -subj '/CN=Mosquitto' && \ | ||
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 3650 && \ | ||
c_rehash . && \ | ||
chown -R mosquitto:mosquitto /mosquitto && \ | ||
chmod 600 /mosquitto/config/certs/* | ||
|
||
EXPOSE 1883 | ||
EXPOSE 8883 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ISC License | ||
|
||
Copyright (c) 2025 Rob Griffiths | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,58 @@ | ||
# Meross utilities | ||
|
||
[](https://github.com/bytespider/Meross/actions/workflows/npm-publish.yml) | ||
|
||
Tools to help configure the Meross devices for purpose of utilising our <a href="https://github.com/bytespider/Meross/wiki/MQTT">own MQTT servers</a>. | ||
Tools to help configure the Meross devices to use private MQTT servers. | ||
|
||
## Requirements | ||
|
||
Before you can use the tool to setup your device you need to put it into paring mode and connect to it's Access Point. It's IP address is known as the `--gateway` parameter and is typically `10.10.10.1`. | ||
NodeJS: ^21.0.0, ^20.10.0, ^18.20.0 | ||
NPM: ^10.0.0 | ||
|
||
## Home Assistant | ||
It's possible to get these devices to work with Home Assistant (HASSIO). | ||
<a href="https://github.com/bytespider/Meross/wiki/Home-Assistant-(HASSIO)">Setup Home Assistant MQTT</a> | ||
## Setup | ||
|
||
Once paired and linked to your broker, you can use the <a href="https://github.com/krahabb/meross_lan">Meross Lan</a> integration to control the devices. | ||
TODO: | ||
[Devices with WIFI pairing]() | ||
|
||
[Devices with Bluetooth pairing]() | ||
|
||
## Tools | ||
|
||
### Info | ||
`npx meross info [--inclide-wifi]` | ||
Gets information from the device you are connected to in setup mode and optionally the WIFI SSID's it can see. | ||
|
||
``` | ||
npx meross-info [options] <options> | ||
|
||
Options: | ||
-V, --version output the version number | ||
-a, --ip <ip> Send command to device with this IP address (default: "10.10.10.1") | ||
-u, --user <user-id> Integer id. Used by devices connected to the Meross Cloud | ||
-k, --key <shared-key> Shared key for generating signatures (default: "") | ||
--include-wifi List WIFI Access Points near the device | ||
--include-ability List device ability list | ||
--include-time List device time | ||
-v, --verbose Show debugging messages | ||
-h, --help display help for command | ||
``` | ||
|
||
### Setup | ||
`npx meross setup [options]` | ||
Setup device you are connected to in setup mode | ||
|
||
``` | ||
npx meross-setup [options] <options> | ||
|
||
Options: | ||
-V, --version output the version number | ||
-a, --ip <ip> Send command to device with this IP address (default: "10.10.10.1") | ||
--wifi-ssid <wifi-ssid> WIFI Access Point name | ||
--wifi-pass <wifi-pass> WIFI Access Point password | ||
--wifi-encryption <wifi-encryption> WIFI Access Point encryption (this can be found using meross info --include-wifi) | ||
--wifi-cipher <wifi-cipher> WIFI Access Point cipher (this can be found using meross info --include-wifi) | ||
--wifi-bssid <wifi-bssid> WIFI Access Point BSSID (each octet seperated by a colon `:`) | ||
--wifi-channel <wifi-channel> WIFI Access Point 2.5GHz channel number [1-13] (this can be found using meross info --include-wifi) | ||
--mqtt <mqtt-server> MQTT server address | ||
-u, --user <user-id> Integer id. Used by devices connected to the Meross Cloud (default: 0) | ||
-k, --key <shared-key> Shared key for generating signatures (default: "") | ||
-t, --set-time Configure device time with time and timezone of current host | ||
-v, --verbose Show debugging messages (default: "") | ||
-h, --help display help for command | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in the README: 'seperated' should be corrected to 'separated'.
Copilot uses AI. Check for mistakes.