Comments (24)
Ok, I expect issues since I havent tested, even with mosquitto, but try dis
You have to edit mqtt_serverandport, mqtt_username, mqtt_password directly in the .JSON config file. Leave username blank if there is none.
from bi-aidetection.
@packetwarrior - I fixed a few MQTT related bugs that certainly would have stopped it from working on your end, but I'm still having a hard time testing - not exactly sure what is expected, and the test servers keep giving 'unable to connect to the remote server' (maybe I abused them or have too many connections) - iot.eclipse.org, broker.hivemq.com, test.mosquitto.org. Using default port of 1883.
In the new version, see camera > settings > MQTT > Settings screen, and the TEST button
from bi-aidetection.
See if this guy is working any better for you.
AITOOL-VORLONCD.zip
from bi-aidetection.
I think we have a winner here, initial testing looks really good, will do some more checking tomorrow. In theory, one could also control Blue Iris now, without having to deal with Trigger URLs and web server configuration issues.
Thank you very much for all the extra effort you're putting into this, I know debugging these seemingly minor issues can be a major headache. Great job!
from bi-aidetection.
@ccmacaluso Try it. Its in the latest release:
https://github.com/VorlonCD/bi-aidetection/releases
from bi-aidetection.
I've never used it, can you provide more detail and examples? Would it need to support AUTH TLS like blue iris?
from bi-aidetection.
MQTT follows the Publisher/Subscriber model, with the messages organized in topics. In case of alerting, only the subscriber portion matters.
Check out https://mosquitto.org which even discusses how you can use their test setup to validate your components are working. From what I can tell, most of the applications I use actually rely on the Mosquitto libraries to do all the heavy lifting, which is all open source.
Ideally, authentication should be supported, and if possible TLS as well (which should be easier when using the Mosquitto libraries).
from bi-aidetection.
what does your topic/payload look like?
from bi-aidetection.
Hopefully these examples make sense:
AI Tool as a Subscriber (via EventGhost right now):
topic: hostname_eg/aitool/driveway/motion
payload: [parameters]
Blue Iris as a Publisher (alert):
topic: hostname_bi/c_driveway
payload: 0 or 1 (motion started vs stopped)
Blue Iris as a Subscriber
Example of my home automation triggering Blue Iris to record the driveway camera
topic: hostname_bi/admin
payload: camera=driveway&trigger&memo=garage_door
from bi-aidetection.
wow, that was fast!
I didn't have much time to test this, but the first run didn't trigger. After it processed the first pic, the log showed it saved the settings again, which removed the MQTT entries (probably because there's no GUI entry for them?).
I'll do some more testing tomorrow, but your work is very much appreciated!
from bi-aidetection.
@packetwarrior - Thanks for testing!
So you would have to edit the mqtt settings in the JSON file when the program is NOT running, otherwise it would have overwritten the settings you manually edited.
I'll need logs if still not working as expected. (stripped of any passwords of course :)
from bi-aidetection.
Alright major progress for sure!
- The Test button in the MQTT Settings dialog box works perfectly (shows [camera] as payload, but that makes sense).
- When I throw a new pic in the directory, it triggers the MQTT alert (so connection is good), however it's being posted to the / topic, and the payload is the content of Params from the previous "Run external program" option, so probably just a bad variable reference?
I did test the test.mosquitto.org server with my MQTT client, which works, but there were so many topics posted, it took a few minutes to load. Check out https://www.hivemq.com/mqtt-toolbox/ for some of the popular clients.
from bi-aidetection.
How is this working? (The test screen will still not resolve [camera] etc)
from bi-aidetection.
Unfortunately, same behavior. For testing purposes, I saved the settings again, but changed the (disabled) run external program 'Params' text box to the literal string "params value". In the logs below, you can see it's using that value for both the topic and payload content.
[15:38:45.840]: DetectObjects> x.x.x.x:5000 - The summary:car (99.42%)
[15:38:45.844]: DetectObjects> x.x.x.x:5000 - (5/6) Performing alert actions:
[15:38:45.846]: Trigger> Copying image to network folder...
[15:38:45.852]: Trigger> -> Image copied to network folder.
[15:38:45.856]: PublishAsync> MQTT: Sending topic 'params value' with payload 'params value' to server 'mqtt.server:1883'...
[15:38:45.862]: PublishAsync> MQTT: ### CONNECTED WITH SERVER 'mqtt.server:1883' ### - Result: Success, ''
[15:38:45.868]: PublishAsync> MQTT: ### SUBSCRIBED to topic 'params value'
[15:38:45.888]: PublishAsync> MQTT: ...Sent in 31ms, Reason: 'Success' (0 - '')
from bi-aidetection.
Driving me buggy, I dont see any bad variable references. :) I can change topic and payload in actions and it sticks - Maybe you are also running as service and settings dont stick because of that?
What if you make sure AITOOL.EXE has been fully closed in task manager, then edit AITOOL.SETTINGS.JSON file for the camera in question:
"Action_mqtt_topic": "topic",
"Action_mqtt_payload": "payload",
from bi-aidetection.
The settings are sticking fine (no service configured, and I wouldn't be able to overwrite the executable if it was still running), it's just not using them. This is pulled from my Settings file, which the UI also reflects:
"Action_mqtt_enabled": true,
"Action_mqtt_topic": "ai/[camera]/motion",
"Action_mqtt_payload": "[detections]",
"Action_mqtt_retain_message": false,
from bi-aidetection.
This featureset would be incredible if we could get it into the next release of AITool. Let me know if I can help to test.
from bi-aidetection.
Verified this works for me as well, thanks for adding it!
from bi-aidetection.
just stumbled on this fork, awesome work! feature request: currently, MQTT only fires when there a relevant alert. Can you make it configurable where it would fire when there's no relevant objects as well? I'm planning to use this as an occupancy sensor. it would be good to do a check to make sure there are no persons in the room before turning off the lights.
from bi-aidetection.
@willngogit - Done.
https://github.com/VorlonCD/bi-aidetection/releases
from bi-aidetection.
Wow.. that was quick!
from bi-aidetection.
@willngogit - tiny bug fix if you already downloaded, re-download.
from bi-aidetection.
@willngogit - tiny bug fix if you already downloaded, re-download.
re-downloaded. seems to be working. thanks!
from bi-aidetection.
This version will use the "Last Will" feature of MQTT. When it first connects it will send a LWT "AITool/status" topic with payload of "Offline". So you should see that message if AITOOL ever crashes and you are using MQTT. When it connects it now sends "Online" to the same topic. If you want to change this, close the program, edit AITOOL.SETTINGS.JSON and change "mqtt_LastWillTopic" and "Mqtt_LastWillPayload" settings.
Let me know how it works.
from bi-aidetection.
Related Issues (20)
- telegram notifications skip every 10 minutes feature HOT 19
- New Win11 Updates broke AITool HOT 5
- detection gone weird HOT 1
- Not sure how to correct this error- debug file deleted HOT 6
- Deepstack randomly failing HOT 1
- disadvantages of not using queue? HOT 5
- Not a Issue- Just a Question HOT 2
- Separate "Triggering Objects" for Telegram is not working HOT 2
- Save Button Not Showing On Latest Update 2.5.25 HOT 3
- 2.5.44 Custom models on "AiServerURL's" always saves as Linked. HOT 5
- AITool crashes when adding cameras HOT 1
- run external program suddenly stopped working after windows 10 22H2 update HOT 1
- Telegram "Invalid Format" HOT 1
- can't add a Camara HOT 7
- database disk image is malformed [SQLiteException] Mod: InsertHistoryItem(History hist) Line:258:21267195 HOT 6
- GUI Freezes HOT 1
- AI Tool crashed with a System Error warning about a buffer overrun HOT 6
- Bitdefender sees Telegram.bot.dll as malware HOT 1
- System.InvalidOperationException: Failed to compare two elements in the array. HOT 5
- Add Support for SimpleX Chat - Open source privacy focused messenger HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bi-aidetection.