-
Notifications
You must be signed in to change notification settings - Fork 86
mqtt store setup
Chris Petersen edited this page Oct 16, 2014
·
1 revision
mqtt-store-setup sets up ln_store sharing using a MQTT broker.
Parameter | Description |
---|---|
store | Store name |
args | Optional: MQTT arguments |
Note: All arguments natively supported by (make-mqtt . args) are also supported here. Only new arguments are listed below
Attribute | Description |
---|---|
subscribe | List of ("variable" "mqtt-topic" qos) lists, which are imported |
publish | List of ("variable" "mqtt-topic" qos retain) lists, which are exported |
Example 1: Make a connection to a mosquitto broker running on localhost:1883. Export the local variable "LocalTemp" as MQTT topic "inside/temperature, while importing the MQTT topics "inside/temperature" and "outside/temperature" as "InsideTemp" and "OutsideTemp" respectively.
> (define store (make-store "test"))
> (mqtt-store-setup store 'host "127.0.0.1" 'port 1883
'subscribe '(("InsideTemp" "inside/temperature" 2)
("OutsideTemp" "outside/temperature" 0))
'publish '(("LocalTemp" "inside/temperature" 2 0))
)
#t
> (store-ref store "InsideTemp")
#f
> (store-set! store "LocalTemp" 23.3)
#f
> (thread-sleep! 0.5)
> (store-ref store "LocalTemp")
23.3
> (store-ref store "InsideTemp")
23.3
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip