Problem receiving data in Live Mode


Hello all,
I’m developing a Device with Live Mode in Extension Builder. I want communicate the Device with a hardware based on Arduino Uno.
For testing the communication, I wrote a firmware that answer a string “HelloMblock” every time I send a commmand to the hardware in a block.
Every time the board send back the response, I get a “onRead(app, device)” callback call (OK) but I can read the data Ok with “device.readText()” just the first time. I can’t get the data the sucesives reads, even if the onRead callback is called. The second call and sucesives the variable “text” (see below) is empty.
Here is the onRead callback code:

// when receiving and reading byte
async onRead(app, device) {
let text = await device.readText();
app.log('Received from dev: ', text);

Note I needed to add the “async” definition to the callback to get any data. It doesn’t work without this.
I tried with readHex() but is the same, just receive the first time I send the commnad.
This is the complete console output, it shows when the callback is executed:

I checked the hardware with a serial terminal and It always sends a response.

I need to do something else to continuing receiveing data?

Thank you very much


Hi ralcoberro,
That is the permission issue.
We can’t open the permission for live mode.
Hope you can understand.


Is it possible right now?
Can I use readHex more than once in a new device in live mode?

Thanks, regards.


I think that mBlock online has a “sandbox”


(a sandbox is a code environment that only allows specific codes to run for safety reasons. Since your extension could be malicious, it is “unsandboxed” after it is reviewed by makeblock to ensure it is safe and publishable)

After the extension is published, it may work because it is no longer sandboxed in preview mode.


It is not working on desktop app, too…


I thought you said it was??? And is it published yet?


I am now making tests so I can decide if I can go on with this device/extension. May I publish it anyway? it is incomplete.

I’ve tried in desktop app and web mode, and I only can get the first bytes received and no more.


You can probably publish it. Just make sure words like “test” aren’t included, or they may reject it. :slight_smile:


@Best_codes I’ve published and download the published version, but unfortunately it is the same behaviour. I’ve read above that it was a permissions issue in live mode. Is it resolved?


You published it?




Yes, it is a device.


It says “in review?”
Sorry, I have to go now.


In my opinion the situation is clear enough. Technical support replied that the live mode is specifically blocked for non-original devices. A separate question is how to bypass this blocking. But is it worth trying? Live mode in mBlock5 works very badly. It is much more efficient for such tasks to use the Snap4arduino environment with a modified Firmata firmware.