Skip to content

Commit 25f9a5e

Browse files
committed
added debian package, use jar form github
1 parent 89c6e77 commit 25f9a5e

File tree

1 file changed

+56
-16
lines changed

1 file changed

+56
-16
lines changed

saic-java-mqtt-gateway/README.md

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,59 @@ The ABRP_USER_TOKEN is optional. If you provide it, the gateway will also publis
2929

3030
For the token, add comma-sepparated entries for each vehicle like this: {VIN=token,VIN2=token2,...}
3131

32-
### 2. Run from command line
32+
### 2. Debian Package
3333

34-
You can also run the gateway from the command line. For this, you need to build the jar file first.
34+
Download the Debian package `saic-ismart-mqtt-gateway-VERSION.deb` from https://github.com/SAIC-iSmart-API/saic-java-client/releases/latest.
3535

36-
From the parent project, run:
36+
Install the MQTT gateway with apt:
37+
38+
```bash
39+
apt-get install saic-ismart-mqtt-gateway-VERSION.deb
40+
```
41+
42+
Configure the MQTT gateway in `/etc/saic-mqtt-gateway.toml`:
43+
44+
```toml
45+
[mqtt]
46+
uri = "tcp://localhost:1883"
47+
username = "mqtt_user"
48+
password = "mqtt_pass"
49+
50+
[saic]
51+
uri = "https://tap-eu.soimt.com"
52+
username = "ismart_user"
53+
password = "ismart_password"
54+
55+
[abrp]
56+
api-key = "8cfc314b-03cd-4efe-ab7d-4431cd8f2e2d"
57+
58+
[[abrp.token]]
59+
"vin1" = "token1"
60+
61+
[[abrp.token]]
62+
"vin2" = "token2"
3763
```
38-
mvn package
64+
65+
Enable and start the gateway:
66+
67+
```bash
68+
systemctl enable saic-mqtt-gateway
69+
systemctl start saic-mqtt-gateway
3970
```
4071

41-
If everything goes right, you will have a jar file (saic-ismart-mqtt-gateway-0.0.0-SNAPSHOT-full.jar)
42-
in the target folder. You can run it with the following command:
72+
You can check the log output with
73+
74+
```bash
75+
journalctl -u saic-mqtt-gateway -f
4376
```
44-
java -jar saic-ismart-mqtt-gateway-0.0.0-SNAPSHOT-full.jar \
77+
78+
### 3. Run from command line
79+
80+
Download the full-jar package `saic-ismart-mqtt-gateway-VERSION-full.jar` from https://github.com/SAIC-iSmart-API/saic-java-client/releases/latest.
81+
82+
You can run it with the following command:
83+
```bash
84+
java -jar saic-ismart-mqtt-gateway-VERSION-full.jar \
4585
--saic-user={your saic user} \
4686
--saic-password={your saic password} \
4787
--mqtt-uri={your mqtt broker uri} \
@@ -65,16 +105,16 @@ as a starting point: https://github.com/vvatelot/mosquitto-docker-compose
65105
The gateway supports the following commands from mqtt topics:
66106

67107
Base topic is always:
68-
saic/{saic-user}/vehicles/{vin}
108+
`saic/{saic-user}/vehicles/{vin}`
69109

70-
* drivetrain/hvBatteryActive {true|false}
71-
* climate/remoteClimateState {true|false}
72-
* doors/locked {true|false}
73-
* refresh/mode {periodic|off|force}
74-
* refresh/period/active {seconds} -> Interval in seconds to poll the car state when hvBattery is active (30s default)
75-
* refresh/period/inActive {seconds} -> Interval in seconds to poll the car state when hvBattery is inActive (86400s default)
76-
* refresh/period/inActiveGrace {seconds} -> -> Interval in seconds handle car state as active after hvBattery was disconnected (600s default)
110+
* `drivetrain/hvBatteryActive` {true|false}
111+
* `climate/remoteClimateState` {true|false}
112+
* `doors/locked` {true|false}
113+
* `refresh/mode` {periodic|off|force}
114+
* `refresh/period/active` {seconds} -> Interval in seconds to poll the car state when hvBattery is active (30s default)
115+
* `refresh/period/inActive` {seconds} -> Interval in seconds to poll the car state when hvBattery is inActive (86400s default)
116+
* `refresh/period/inActiveGrace` {seconds} -> -> Interval in seconds handle car state as active after hvBattery was disconnected (600s default)
77117

78-
To set these values, just post a message to the corresponding topic plus "/set" with the desired value.
118+
To set these values, just post a message to the corresponding topic plus `/set` with the desired value.
79119

80120
Further commands will be supported in the future.

0 commit comments

Comments
 (0)