Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config.json Example + Execution of Script doesn't work #4

Closed
Hartmut01 opened this issue Dec 12, 2020 · 2 comments
Closed

Config.json Example + Execution of Script doesn't work #4

Hartmut01 opened this issue Dec 12, 2020 · 2 comments

Comments

@Hartmut01
Copy link

Hello,
Thank you a lot for making this Project for the Ioniq. :)
I'm am trying to get IOTConnect running on my Raspberry but I have a few difficulties.

My Setup:
I have a OBD Dongle which is working with my EvNotify App on the Phone.
Hotspot on the Phone and Raspberry Pi Zero W running your Script, Node Red and Mosquitto mqtt broker.
I do not have a GPS Antenna so only the Ioniq monitor is what I want to get running for the moment.

I'm trying to follow your "Getting started" and Tutorial but am having problems with the execution of the script.
The Command python3 -m /opt/IOTConnect/iotconnect gives me the error: /usr/local/bin/python3.8: No module named /opt/IOTConnect/iotconnect
Can you help me with this issue? Probably nothing in your Script but related to me not knowing python very well.

Scecond uncertanty for me is the config.josn file. I don't see any example of how to insert the monitors or publishers.
Below is my try of monitoring the Ioniq and publishing through mqtt.
Is it possible to publish without User and Password or do I need to configure this in my mqtt broker?
Is the Broker "localhost" possible?

{
    "publishers":[
        {
            "class": "iotconnect.publishers.mqtt.MQTTPublisher",
            "broker": "localhost",
            "port": 1883,
            "topic_prefix": "Ioniq/",
            "connection_retries": 3,
            "qos": 1,
            "retain": true
         }
    ],
    "monitors":[
        {
            "class": "iotconnect.monitors.noop.NoopMonitor",
            "interval": 10
        }

	{  
	    "class": "iotconnect.monitors.ioniqev.IoniqEVMonitor",
	    "interval": 5
        }
    ]
}

Thanks a lot in advance for your script and the work you have already done in this project :)

@hokus15
Copy link
Owner

hokus15 commented Dec 18, 2020

Hi,
First you can only have the ODB dongle connected with one device at the same time. So you either you connect to the phone or the Raspberry Pi (at the same time).

If you try to run the script manually from the command line make sure you are in the /opt/IOTConnect cd /opt/IOTConnect folder and execute the command:

python3 -m iotconnect

I need to update the documentation thanks for poiting it.

Regarding the config file:
As a json array you need to separate every object with the comma character ,.
So the monitors part will be:
"monitors":[ { "class": "iotconnect.monitors.noop.NoopMonitor", "interval": 10 }, { "class": "iotconnect.monitors.ioniqev.IoniqEVMonitor", "interval": 5 } ]

But my recommendation is that you remove the NoopMonitor as it does nothing (it's only for demonstration purposes) so the monitors part will be like this:
"monitors":[ { "class": "iotconnect.monitors.ioniqev.IoniqEVMonitor", "interval": 5 } ]
Regarding the MQTT part right now it only supports secure connection with login and password. It should be possible to connect to any secure login/password protected MQTT broker (so you could connect to localhost).

I hope that helps, feel free to contact me if you have more doubts or problems.
Regards
Jordi

@hokus15
Copy link
Owner

hokus15 commented Jan 10, 2021

As no other questions I'll close the issue.

@hokus15 hokus15 closed this as completed Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants