njh / k8055mqtt

Self contained MQTT client for controlling the the Velleman K8055 / VM110 Board
GNU General Public License v3.0
3 stars 3 forks source link

libusb_set_configuration() error #5

Open Maarten69 opened 4 years ago

Maarten69 commented 4 years ago

I finally succesfully compiled the source (after some help from you). I used following commands:

$ git clone https://github.com/njh/k8055mqtt.git $ sudo apt install libusb-dev $ sudo apt install libmosquitto-dev $ ./autogen.sh $ ./configure $ make $ make install (did not work cause no permission, so I used: sudo make install)

I opened terminal at usr/local/bin and run: $ dmesg | grep Velleman (to test if card was recognised) $ ./k8055mqtt -h test.mosquitto.org

libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/007: Permission denied libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes. libusb_open_device_with_vid_pid() error. Failed to initialise K8055 device.

So i used sudo: $ sudo ./k8055mqtt -h test.mosquitto.org

libusb_set_configuration() error. Failed to initialise K8055 device.

Any help to get this working correctly?

Maarten69 commented 4 years ago

I'm not sure what happened. * I added a rule for k8055 /etc/udev/rules.d as described in https://github.com/jodersky/k8055 and reboot the PC.

Now my output is:

Connecting to test.mosquitto.org:1883... LOG: Client k8055 sending CONNECT LOG: Client k8055 received CONNACK (0) Connected to MQTT server. LOG: Client k8055 sending SUBSCRIBE (Mid: 1, Topic: k8055/#, QoS: 0, Options: 0x00) LOG: Client k8055 received SUBACK k8055_device_poll() failed to read.

edit* It's only working after I used another program to open the k8055 board, after that k8055mqtt will connect. Do not know how to circumvent this...