Skip to content

Commit 6e7b2df

Browse files
committed
fix5
1 parent 82c501c commit 6e7b2df

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

controller/rpc_client.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"context"
55
"encoding/json"
6+
"fmt"
67
"log"
78
"math"
89
"strconv"
@@ -46,7 +47,8 @@ func main() {
4647

4748
if module.Name == "raspberrypi-0" {
4849
var obj Dht11
49-
err = json.Unmarshal([]byte(res), &obj)
50+
jsonString := string(fmt.Sprintf("`%s`", res))
51+
err = json.Unmarshal([]byte(jsonString), &obj)
5052
if err != nil {
5153
log.Fatalf("error: %v", err)
5254
}

modules/raspberrypi5/devices/dht11/app/main.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
dhtDevice = _device(_board)
1313

1414
try:
15+
1516
d = dict();
1617

1718
d['t'] = dhtDevice.temperature

0 commit comments

Comments
 (0)