Troubleshooting

Permission

1. What does User cannot access resource mean?

  • Permissions, such as CRUD (depending on the item), must be added to the user's role.

  • You can add the user to a role with readily available permissions.

These can be updated in the Roles section.

Portals

1. How do I debug the widget’s parser?

  • The debug button adds the debugger keyword to the parser, or the user can type the debugger keyword into the parser. The keyword works as a breakpoint.

  • Ensure the developer tools window is open in the browser.

  • Every time the widget code is executed, the code will hold at the breakpoint. From here, the browser’s developer tools’ features can help you move to the next breakpoint, further through the code, etc.

Messaging

1. What are the MQTT connection error codes and their definitions inside of ClearBlade?

  • The MQTT connect packet’s error codes can be found here.

2. Why is the receiver not receiving MQTT messages from the sender?

  • Ensure the user/device/developer executing the code that sends and receives is assigned to a designated role with MQTT topic permissions.

  • You may have some network issues, and you can try QoS 2 or 3, based on your use case, to ensure the message is published by the publisher and received by the subscribers.

  • Network monitoring tools can help find which one of the steps may be going wrong:

    • Is the message getting published?

    • Is the message being received by other subscribers?

  • Are you using shared topics? If multiple subscribers are in your group, the messages will be load balanced.

  • Ensure you are viewing on the edge’s console if you publish the data to the edge.

  • Handling shared topics: $share/myShareGroupName/myTopic
    A message sent to myTopic will be shared between all $share/myShareGroup/myTopic subscribers. One subscriber might receive the first message, and another might receive the second message. However, if all subscribers subscribe to myTopic, then each one gets every message.

3. What are the Quality of Service (QoS) codes, and what do they do?

  • QoS codes and their definitions can be found here. It is not recommended to use a QoS greater than 0. In normal network environments, a QoS of 0 has sufficient reliability. The message publisher and subscriber can set a QoS value.

4. Why do I get disconnected from MQTT when I attempt to subscribe or publish?

  • Ensure the user/device/developer subscribing/publishing is assigned a designated role with MQTT topic permissions.

SDK

1. How do I use PythonSDK to create an MQTT session?

  • You must specify the use_tls boolean and port (1883 for TLS or 1884 for non-TLS). Example: mqtt = system.Messaging(user_device, port=1883, use_tls=False) mqtt = system.Messaging(user_device, port=1884, use_tls=True)

2. How do I use PythonSDK to connect a user/device using a previously acquired token?

  • user_device = system.Device(device_name,authToken=device_tokens[device_name])

3. Why are only 340 clients allowed to connect in one PythonSDK instance?

  • This is due to Linux’s limitations. You must use multiprocessing within the Python program or run it multiple times to connect more clients.