As the title said, I want to get communication between raspberry pi 3 running OH2 and arduino via nrf24l01 module.
Here is the .item file:
Switch Light_GF_Living_Ceiling "Living room Ceiling [MAP(switch.map):%s]" (GF_Living, Lights){mqtt=">[mymosquitto:livingroomceil:command:default]"}
Number Temperature_GF_Living "Living room Temperature [%.1f °C]" <temperature> (Temperature, GF_Living){mqtt="<[mymosquitto:livingroomtemp:state:default]"}
The switch.map:
OFF=OFF
ON=ON
undefined=Unknown
And .sitemap file;
Switch item=Light_GF_Living_Ceiling
Text item=Temperature_GF_Living
When I used OH1.8.3, there was so easy to set up mqtt configuration inside openhab.cfg and then use 2 sets of commands below to play around:
mosquitto_sub -d -i subcriber -h raspberrypi.mshome.net -t livingroomtemp
mosquitto_pub -d -i publisher -h raspberrypi.mshome.net -t livingroomceil -m ON
And the result was perfect, I received the value of livingroomtemp when I used mosquitto_sub and also I could control livingroomceil by using mosquitto_pub
But when I migrate to OH2, I amend the mqtt.cfg file like this:
#
# Define your MQTT broker connections here for use in the MQTT Binding or MQTT
# Persistence bundles. Replace <broker> with an ID you choose.
#
# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
mymosquitto.url=tcp://localhost:1883
# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a default one is generated.
mymosquitto.clientId=openHAB
# Optional. User id to authenticate with the broker.
#<broker>.user=<user>
# Optional. Password to authenticate with the broker.
#<broker>.pwd=<password>
# Optional. Set the quality of service level for sending messages to this broker.
# Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2
# (Deliver exactly once). Defaults to 0.
mymosquitto.qos=0
# Optional. True or false. Defines if the broker should retain the messages sent to
# it. Defaults to false.
mymosquitto.retain=true
# Optional. True or false. Defines if messages are published asynchronously or
# synchronously. Defaults to true.
mymosquitto.async=true
# Optional. Defines the last will and testament that is sent when this client goes offline
# Format: topic:message:qos:retained <br/>
#<broker>.lwt=<last will definition>
when I use the commands above, I only get the respond:
Unable to connect (Lookup error.).
here is the output of log file:
==> /var/log/openhab2/openhab.log <==
2017-01-18 23:29:48.363 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'demo.items'
2017-01-18 23:29:48.395 [ERROR] [arthome.core.items.dto.ItemDTOMapper] - Group function 'AND' requires two arguments. Using Equality instead.
2017-01-18 23:29:48.400 [ERROR] [el.item.internal.GenericItemProvider] - Binding configuration of type 'mqtt' of item 'Light_GF_Living_Ceiling' could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: Configuration 'mymosquitto:livingroomceil:command:default' is not a valid outbound configuration: Configuration requires 5 parameters separated by ':'
at org.openhab.core.binding.internal.BindingConfigReaderDelegate.processBindingConfiguration(BindingConfigReaderDelegate.java:50)[176:org.openhab.core.compat1x:2.0.0.201701091302]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:312)[123:org.eclipse.smarthome.model.item:0.9.0.201701090931]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:284)[123:org.eclipse.smarthome.model.item:0.9.0.201701090931]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.processBindingConfigsFromModel(GenericItemProvider.java:167)[123:org.eclipse.smarthome.model.item:0.9.0.201701090931]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.modelChanged(GenericItemProvider.java:347)[123:org.eclipse.smarthome.model.item:0.9.0.201701090931]
at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:207)[122:org.eclipse.smarthome.model.core:0.9.0.201701090931]
at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:120)[122:org.eclipse.smarthome.model.core:0.9.0.201701090931]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:270)[122:org.eclipse.smarthome.model.core:0.9.0.201701090931]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.access$1(FolderObserver.java:264)[122:org.eclipse.smarthome.model.core:0.9.0.201701090931]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver$WatchQueueReader.processWatchEvent(FolderObserver.java:145)[122:org.eclipse.smarthome.model.core:0.9.0.201701090931]
at org.eclipse.smarthome.core.service.AbstractWatchQueueReader.run(AbstractWatchQueueReader.java:122)[98:org.eclipse.smarthome.core:0.9.0.201701090931]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
2017-01-18 23:29:48.411 [ERROR] [arthome.core.items.dto.ItemDTOMapper] - Group function 'AND' requires two arguments. Using Equality instead.
2017-01-18 23:29:48.426 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'demo.items'
2017-01-18 23:29:48.455 [ERROR] [arthome.core.items.dto.ItemDTOMapper] - Group function 'AND' requires two arguments. Using Equality instead.
2017-01-18 23:29:48.459 [ERROR] [el.item.internal.GenericItemProvider] - Binding configuration of type 'mqtt' of item 'Light_GF_Living_Ceiling' could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: Configuration 'mymosquitto:livingroomceil:command:default' is not a valid outbound configuration: Configuration requires 5 parameters separated by ':'
at org.openhab.core.binding.internal.BindingConfigReaderDelegate.processBindingConfiguration(BindingConfigReaderDelegate.java:50)[176:org.openhab.core.compat1x:2.0.0.201701091302]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:312)[123:org.eclipse.smarthome.model.item:0.9.0.201701090931]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:284)[123:org.eclipse.smarthome.model.item:0.9.0.201701090931]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.processBindingConfigsFromModel(GenericItemProvider.java:167)[123:org.eclipse.smarthome.model.item:0.9.0.201701090931]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.modelChanged(GenericItemProvider.java:347)[123:org.eclipse.smarthome.model.item:0.9.0.201701090931]
at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:207)[122:org.eclipse.smarthome.model.core:0.9.0.201701090931]
at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:120)[122:org.eclipse.smarthome.model.core:0.9.0.201701090931]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:270)[122:org.eclipse.smarthome.model.core:0.9.0.201701090931]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.access$1(FolderObserver.java:264)[122:org.eclipse.smarthome.model.core:0.9.0.201701090931]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver$WatchQueueReader.processWatchEvent(FolderObserver.java:145)[122:org.eclipse.smarthome.model.core:0.9.0.201701090931]
at org.eclipse.smarthome.core.service.AbstractWatchQueueReader.run(AbstractWatchQueueReader.java:122)[98:org.eclipse.smarthome.core:0.9.0.201701090931]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
2017-01-18 23:29:48.471 [ERROR] [arthome.core.items.dto.ItemDTOMapper] - Group function 'AND' requires two arguments. Using Equality instead.
Anybody please help!!!1