Hi there - I built a mycroft on an orange pi plus. using armbian as the os. it working well and everything, the armbian is a miminal install, so it could be just a lack of prerequisites where my problem is arising. from .
any ways I want to build a spi screen interface. both local and remote ( possibly most probably based on mqtt) but I am having trouble getting the message bus to work for me
i tried your example
#! /usr/bin/env python3
import sys
from websocket import create_connection
uri = 'ws://' + sys.argv[1] + ':8181/core'
ws = create_connection(uri)
print("Sending " + sys.argv[2] + " to " + uri + "...")
if len(sys.argv) >= 4:
data = sys.argv[3]
else:
data = "{}"
message = '{"type": "' + sys.argv[2] + '", "data": ' + data +'}'
result = ws.send(message)
print("Receiving..." )
result = ws.recv()
print("Received '%s'" % result)
ws.close()
python not my strongest suit i like perl more
but I get this as an error
Traceback (most recent call last):
File "./testpy3", line 5, in <module>
uri = 'ws://' + sys.argv[1] + ':8181/core'
IndexError: list index out of range
it probably something simple but since it python I not sure where to start
would some be kind enough to point me in the right direction…
Speaking of the mqtt thing…we just finished cooking a roast using my custom meat probe based on a Adafruit featherm0 wifi with an lcd. It’s a pretty nice setup. I can select the type of meat using the lcd and let’r rip. It projects the finish time and I can monitor it on my notebook using a simple script that watches the mqtt messages. On my todo list is to create a MyCroft skill that monitors the meat probe.
currently it not an issue with mqtt… my current issue is just to get mycroft message bus example to work. connect to the it and display data coming out of it so i can parse it .
I assume that is what the above mycroft example is about
How did you call the python-script? sys.argv is a list of all parameters that are passed to the script when being called (argv[0] is the name of the script itself - “testpy3.py” in your case).
Error message “list index out of range” for sys.argv[1] means most likely that you didn’t pass any parameter at all.
Looking at the code you need to pass at least two parameters: 1) IP of the server running messagebus 2) the message-type to be sent over the bus. 3) optional: message-data