Skip to content

External clients not receiving service-generated messages #270

@dragazo

Description

@dragazo

In PyBlox, I have the following code (in a sprite):

device = '...'   # change these
password = '...' # change these

@onstart()
def my_onstart(self):
    nb.phone_iot.set_credentials(self.device, self.password)
    nb.phone_iot.listen_to_sensors(self.device, { 'accelerometer': 100 })

@nb.on_message('accelerometer')
def my_onmessage(self, x, y, z):
    self.say(x)

Nothing gets displayed, but the cloud server shows posts to /network/messages/ and NetsBlox/PyBlox-generated messages are correctly received in PyBlox (just not service-generated messages). It looks like what's happening is that the sendMessage feature on external client instances (which are used as the socket objects provided to services) are always explicitly constructing a browser target object, so lookup of the target fails and the message is dropped at cloud.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions