Jump to content

OT: Sonof devices


georgelza

Recommended Posts

@georgelza - if you look at the build log you'll see the first two lines are complaints about git.  They probably refer to this command:  https://github.com/victronenergy/venus-docker/blob/master/build.sh#L4 and this one:  https://github.com/victronenergy/venus-docker/blob/master/build.sh#L7

I wonder if you'd "cloned" the venus-docker repo (https://github.com/victronenergy/venus-docker) correctly?  Did you run this command?

git clone [email protected]:victronenergy/venus-docker.git

 

Link to comment
Share on other sites

11 minutes ago, admiral said:

@georgelza - if you look at the build log you'll see the first two lines are complaints about git.  They probably refer to this command:  https://github.com/victronenergy/venus-docker/blob/master/build.sh#L4 and this one:  https://github.com/victronenergy/venus-docker/blob/master/build.sh#L7

I wonder if you'd "cloned" the venus-docker repo (https://github.com/victronenergy/venus-docker) correctly?  Did you run this command?


git clone [email protected]:victronenergy/venus-docker.git

 

hehehe nope, as there was no mention of doing it in the GIT page, was wondering/looking for something like that, wondering if it was all being pulled via the docker pull commands, 

let me retry.

G

Link to comment
Share on other sites

my bad, ye I did this, but I did it by downloading and unpacking the clone/download from GIT web site, and not at command line using git clone.

... otherwise I would not have had the build.sh command ;)

if you look at what you get those directories are all empty.

G

Link to comment
Share on other sites

2 minutes ago, SilverNodashi said:

Doesn't Macbook run BSD kernel? @plonkster can that code compile, or run on BSD?

It all runs in docker so it should be fine.  Docker on mac actually runs in a linux vm, and then the docker containers inside that.

(Yes, I agree macos is not a proper OS.  But the laptop works well.)

Link to comment
Share on other sites

it compiles into a docker image, so MAC not relevant.

Problem was I got the code from GIT using the zip file, which I unpacked, I saw the git submodule lines in the build.sh it was them that failed, so by the time steps 1-> 32 started as part of the docker build . -t matt I already had parts missing which then broke everything.

It's building at the moment...

G

Link to comment
Share on other sites

7 minutes ago, georgelza said:

it compiles into a docker image, so MAC not relevant.

Problem was I got the code from GIT using the zip file, which I unpacked, I saw the git submodule lines in the build.sh it was them that failed, so by the time steps 1-> 32 started as part of the docker build . -t matt I already had parts missing which then broke everything.

It's building at the moment...

G

aha. I somehow missed that part.

Link to comment
Share on other sites

1 hour ago, georgelza said:

is there a reference some where ? or example code/python

See the dbus-mqtt readme. Basically you have to send something to the broker to wake it up, a keepalive packet. I usually just send a read request for the serial number, and that causes the whole caboodle to come down. Eg, using an example from a local CCGX running dbus-mqtt:

mosquitto_sub -v -h 192.168.8.52 -t '#'

That subscribes to all topics, and the moment you connect you will see: N/badbeefbad00/system/0/Serial {"value": "badbeefbad00"}

You can then request the serial number in another terminal, eg:

mosquitto_pub -h 192.168.8.52 -m '' -t 'R/badbeefbad00/system/0/Serial'

And then you will see it all come streaming down. That will give you an idea of the things you can subscribe to.

Of course badbeefbad00 will be replaced by whatever your vrm id is.

For a docker instance your IP will probably be something like 172.17.0.1 or some such.

As long as you request SOMETHING every 60 seconds, the data will keep coming.

Edited by plonkster
Link to comment
Share on other sites

... found a /Users/george/Downloads/venus-docker/dbus-mqtt/test, figured i'll try that to unblock the pipe, well this got more interesting... module missing "dbus" and I can't see to get it installed.

Brew install dbus completed

pip install dbus-python failing.

G

Link to comment
Share on other sites

The mosquitto client tools is available inside the docker instance. So there are two ways to go about this.

The easiest one might be to "apt-get install openssh-server" inside the docker instance and expose port 22 (and /etc/init.d/ssh start inside), then you can just ssh in a few times to get multiple terminals, so you can run mosquitto_sub in one and _pub in the other.

The other one is to run "screen" inside the docker instance. This is a terminal aggregator. Might have to google a cheatsheet for it. You can use ctrl+A, C, to open a new terminal, and ctrl+A, space, to switch between them.

Then you don't have to sukkel with installing it on the host.

And then the -h arguments are not needed. It defaults to localhost.

Link to comment
Share on other sites

Uhm, not sure exactly how you are running the docker container - is it with the "run.sh"?

With docker you can also "exec" into the running container - so first do a "docker ps", then identify the container id.  Then you'd do something like:

 docker exec -it container_id /bin/bash

(replacing container_id with the container id you got in the previous step).

It is possible that the image does not have "bash" in it, then I'd replace "/bin/bash" with "/bin/sh".

You'll then be inside the docker container, and will be able to run stuff there.  Unless I am misunderstanding what you are trying to achieve 🙂

Link to comment
Share on other sites

49 minutes ago, admiral said:

You'll then be inside the docker container, and will be able to run stuff there

Yeah... but what if you need MORE than one shell/terminal? That's why I suggested either installing ssh (so you can log in multiple times over the network), or to use screen (which is included).

Link to comment
Share on other sites

4 minutes ago, plonkster said:

Yeah... but what if you need MORE than one shell/terminal? That's why I suggested either installing ssh (so you can log in multiple times over the network), or to use screen (which is included).

I think I'm perhaps just misunderstanding what @georgelza is trying to achieve 🙂

Link to comment
Share on other sites

... not to worry, give the 2 brain cells some switch off time to just sit and chat between themselves and eventually things start clicking.

so ye I went into the container and happily found mosquitto_sub and _pub.

when I issue a _pub I only got back:

root@902ae0f1054c:~# mosquitto_sub -v -h 127.0.0.1 -t '#'
N/0242ac110003/system/0/Serial {"value": "0242ac110003"}

and it now waits... for me to publish more to this subject... PS thats all it came back with. how can I see what other subjects there are.

G

Link to comment
Share on other sites

8 hours ago, georgelza said:

... found a /Users/george/Downloads/venus-docker/dbus-mqtt/test, figured i'll try that to unblock the pipe, well this got more interesting... module missing "dbus" and I can't see to get it installed.

Brew install dbus completed

pip install dbus-python failing.

G

and same brain cells chatted bout this one also. thinking is the dbus is a module they use for their interface between the data bus and the mosquitto server to publish messages, the test script i found is their test script and not relevant for me to test from outside, all I want to do is use python and subscribe to the mosquitto mqtt subjects.

I've gotten mqtt.app to subscribe and issue a wile card # and got the serial number returned as a JSON message so external port subscription works.

G

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...