Issue configuring MQTT "AI on the edge" with Node-Red

I'm using "AI on the edge" (Release: v13.0.7 (Commit: 304b9e0)) on my ESP32-CAM. Here the config.ini file including the MQTT parameters :

[MakeImage]
;LogImageLocation = /log/source
WaitBeforeTakingPicture = 5
;LogfileRetentionInDays = 15
Brightness = 0
Contrast = 0
Saturation = 0
LEDIntensity = 10
ImageQuality = 12
ImageSize = VGA
FixedExposure = false

[Alignment]
InitialRotate = 185
InitialMirror = false
SearchFieldX = 20
SearchFieldY = 20
AlignmentAlgo = default
FlipImageSize = false
/config/ref0.jpg 34 83
/config/ref1.jpg 404 246

[Digits]
Model = /config/dig-class100-0140_s2_q.tflite
CNNGoodThreshold = 0.5
LogImageLocation = /log/digit
LogfileRetentionInDays = 3
main.dig1 84 245 22 38 0
main.dig2 122 245 22 38 0
main.dig3 160 245 22 38 0
main.dig4 198 245 22 38 0
main.dig5 236 245 22 38 0
main.aft1 274 245 22 38 0
main.aft2 312 245 22 38 0
main.aft3 350 245 22 38 0

;[Analog]
Model = /config/ana-class100_0130_s1_q.tflite
;LogImageLocation = /log/analog
;LogfileRetentionInDays = 3
main.ana1 432 230 92 92 false
main.ana2 379 332 92 92 false
main.ana3 283 374 92 92 false
main.ana4 155 328 92 92 false

[PostProcessing]
main.DecimalShift = -3
main.AnalogDigitalTransitionStart = 9.2
PreValueUse = true
PreValueAgeStartup = 720
AllowNegativeRates = false
main.MaxRateValue = 0.05
main.MaxRateType = AbsoluteChange
;main.ExtendedResolution = false
;main.IgnoreLeadingNaN = true
ErrorMessage = true
CheckDigitIncreaseConsistency = false

[MQTT]
Uri = mqtt://aaa.bbb.ccc.ddd:1883
MainTopic = gazmeter
;ClientID = gaz
;user = USERNAME
;password = PASSWORD
;SetRetainFlag = true
;HomeassistantDiscovery = true
;MeterType = gas_m3

;[InfluxDB]
;Uri = http://aaa.bbb.ccc.ddd:8086
;Database = TEMPERATURES
;Measurement = GAZ
;user = 
;password = 

;[GPIO]
;IO0 = input disabled 10 false false 
;IO1 = input disabled 10 false false 
;IO3 = input disabled 10 false false 
;IO4 = built-in-led disabled 10 false false 
;IO12 = input-pullup disabled 10 false false 
;IO13 = input-pullup disabled 10 false false 
LEDType = WS2812
LEDNumbers = 2
LEDColor = 150 150 150

[AutoTimer]
AutoStart = true
Intervall = 5

[DataLogging]
DataLogActive = true
DataLogRetentionInDays = 10

[Debug]
Logfile = 4
LogfileRetentionInDays = 3

[System]
TimeZone = CET-1CEST,M3.5.0,M10.5.0/3
;TimeServer = undefined
;AutoAdjustSummertime = false
;Hostname = undefined
SetupMode = false

NodeRed 1.3.4 is active on my Raspberry PI. Here the configuration :

[{"id":"48c00b80.4b3ba4","type":"mqtt in","z":"fff138d6.dd0458","name":"","topic":"gazmeter","qos":"2","datatype":"auto","broker":"f7fe95c9.07ba4","nl":false,"rap":true,"rh":0,"x":160,"y":940,"wires":[["ac972b42.5bf5e8"]]},{"id":"ac972b42.5bf5e8","type":"debug","z":"fff138d6.dd0458","name":"mqqq","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":940,"wires":[]},{"id":"f7fe95c9.07ba4","type":"mqtt-broker","name":"Compteur_GAZ","broker":"localhost","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"true","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"true","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"true","willPayload":"","willMsg":{},"sessionExpiry":""}]

Mosquitto MQTT is also active. "mqtt in"-node tested successfully. Both "mosquitto_pub -t gazmeter -m "test" " command, as well as http://mqtt-explorer.com/ tool display expected payload msg (="test").

Issue : For some reason, I'm unable to send counter value from my "AI on the edge" system to my NodeRed using MQTT. I suspect a config issue on Node-Red MQTT node. Please find below the logfile of my "AI on the edge" setup. I assume it contains part of the solution.

log.AI.on.the.edge.txt (84.1 KB)

Any hint ?

Welcome to the forum @mimijojo

Is that what you actually have in the config?

Where is mosquitto installed?

Looking at the log it appears to be publishing to subtopics of gazmeter, so I suggest setting your mqtt In node to subscribe to gazmeter/#

Hi,
There was no communication issue between the devices.

I could fix the issue by replacing MainTopic = gazmeter by MainTopic = gazmeter/main/value.

I struggled a bit receiving data as gazmeter/main/value sometimes contains no data. I figured out by first configuring gazmeter/main/raw, as this always contains data.

Thanks !
Brgds,
Michael

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.