mpp-solar icon indicating copy to clipboard operation
mpp-solar copied to clipboard

Accessing Victron SmartShunt over BlueTooth

Open spoonwzd opened this issue 4 years ago • 10 comments
trafficstars

I've paired to my SmartShunt over Bluetooth and mapped /dev/rfcomm0 - but what port and/or --porttype should I be using to make this work?

spoonwzd avatar Oct 24 '21 15:10 spoonwzd

try mpp-solar -p /dev/rfcomm0 -P VED -c vedtext --porttype vserial -b 19200

jblance avatar Oct 25 '21 20:10 jblance

Yeah I did try that actually. It said:

2021-10-24 16:01:04,318:WARNING:vserialio:send_and_receive@50: VSerial read error: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
Parameter                       Value           Unit
error                           Error occured while grabbing data from /dev/rfcomm0

spoonwzd avatar Oct 25 '21 20:10 spoonwzd

did you try with sudo? Are you sure that the /dev/rfcomm0 is correct and functional?

On Tue, 26 Oct 2021 at 09:23, spoonwzd @.***> wrote:

Yeah I did try that actually. It said:

2021-10-24 @.***: VSerial read error: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?) Parameter Value Unit error Error occured while grabbing data from /dev/rfcomm0

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/174#issuecomment-951286532, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNTYERADY4B5JADLSKDUIW4CJANCNFSM5GTRUUUQ .

jblance avatar Oct 25 '21 20:10 jblance

Same with Sudo.

I think the bluetooth stuff is ok

pi@raspberrypi:~ $ sudo bluetoothctl
Agent registered
[bluetooth]# devices
Device C6:C8:E0:78:5F:D5 SmartShunt HQ2107P36Z7
Device C8:47:8C:F3:60:C1 BMS #2
Device C8:47:8C:F5:5C:37 BMS #1
Device C8:47:8C:F5:75:A5 BMS #3
[bluetooth]# connect C6:C8:E0:78:5F:D5
Attempting to connect to C6:C8:E0:78:5F:D5
Connection successful
[SmartShunt HQ2107P36Z7]# trust
[CHG] Device C6:C8:E0:78:5F:D5 Trusted: yes
Changing C6:C8:E0:78:5F:D5 trust succeeded
[SmartShunt HQ2107P36Z7]# pair
Attempting to pair with C6:C8:E0:78:5F:D5
Request passkey
[agent] Enter passkey (number in 0-999999): 000000
[CHG] Device C6:C8:E0:78:5F:D5 Paired: yes
[bluetooth]# exit
pi@raspberrypi:~ $ sudo rfcomm bind 0 C6:C8:E0:78:5F:D5
pi@raspberrypi:~ $ ls /dev/rfcomm*
/dev/rfcomm0

spoonwzd avatar Oct 25 '21 21:10 spoonwzd

sorry i was not thinking straight I havent got SmartShunt working via bluetooth yet - my SmartShunt code is for rs485 connection. The bluetooth code is JKBMS specific and pretty hacky at the moment does /dev/rfcomm0 receive any data ?

jblance avatar Oct 25 '21 22:10 jblance

No worries. I'm a bit of a noob, so I don't quite know how I'd tell if /dev/rfcomm0 was receiving any data.

Thanks

spoonwzd avatar Oct 26 '21 06:10 spoonwzd

Try cat /dev/rfcomm0

On Tue, 26 Oct 2021, 7:58 pm spoonwzd, @.***> wrote:

No worries. I'm a bit of a noob, so I don't quite know how I'd tell if /dev/rfcomm0 was receiving any data.

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/174#issuecomment-951618309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNSCD63XAUOAQXKGJR3UIZNSBANCNFSM5GTRUUUQ .

jblance avatar Oct 26 '21 06:10 jblance

No output from that command at all.

spoonwzd avatar Oct 26 '21 07:10 spoonwzd

Ok, it might have to wait until I figure out a better solution

On Tue, 26 Oct 2021, 8:02 pm spoonwzd, @.***> wrote:

No output from that command at all.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/174#issuecomment-951620498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNSKFECI6FT3I62TPW3UIZN73ANCNFSM5GTRUUUQ .

jblance avatar Oct 26 '21 07:10 jblance

No worries. I'd much rather sort out https://github.com/jblance/mpp-solar/issues/170 anyway :)

spoonwzd avatar Oct 26 '21 07:10 spoonwzd