Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Not working on board only in simulator #17

Open
aqmoreira opened this issue Nov 17, 2018 · 11 comments
Open

Not working on board only in simulator #17

aqmoreira opened this issue Nov 17, 2018 · 11 comments

Comments

@aqmoreira
Copy link

Example file no running in board Micro:bit.

https://makecode.microbit.org/_7ia7bCddr0Ay

@davorradic
Copy link

I'm too trying to write to serial:
input.onButtonPressed(Button.B, function () { basic.showNumber(1) serial.redirectToUSB() serial.writeLine("dit is een test1") let my_data = "output.txt" files.appendLine( my_data, "lll,lll,dddl,ll099" ) files.readToSerial(my_data) })
I followed tutorial on:
https://www.dendrite.me/media/output/mediaid/5a13f86908d73406ab61317c

and when I say:
serial.writeLine("dit is een test1")
It works great and I see it in tera term "dit is een test1"
but when I try to do it like this:
files.readToSerial(my_data)
nothing is showed :(
In the simulator it works, but on Micro:bit it doesn't show up.

@davorradic
Copy link

I just test it with python and writing file is working perfect :)
For my students I really need JavaScript and it would be great to get this done with JavaScript and to avoid python

@davorradic
Copy link

I see there are many commits, how could I include the old commits of the file to my makecode on windows? I really want to work with JavaScript and not with python.

@johnhunt
Copy link

Can confirm the same here... cannot use the web editor/JS - works in simulator but totally dead on board (no code runs at all). Good to know it's still possible via python though.

@asandven
Copy link

Can confirm the same. Feedback from Micro:bit Foundation:
"I'm afraid the filesystem plugin does not work well with the updated MakeCode editor and that is why it is still in Beta. I would suggest you look at MicroPython for support doing this.
https://microbit-micropython.readthedocs.io/en/latest/filesystem.html"

@Cybot101
Copy link

Cybot101 commented Mar 3, 2019

It looks like there is an issue with the StringData type being passed into the files.cpp methods.
I've 'hacked' together a working version that simply replaces all the StringData arguments with String, and adjusted where needed, but I haven't yet properly tested and verified it.

@roctopwerk
Copy link

@Cybot101 How could I fix it then? So I don't use python, but stay with Javascript?

@Cybot101
Copy link

Cybot101 commented Apr 2, 2019

@roctopwerk
My Fork you are welcome to import and try out, but it's not 'official'. It's been working for me so far.
github.com/Cybot101/pxt-filesystem
I haven't had time to clean up for a Pull Request here.

@omarbenhamid
Copy link

@Cybot101 fork worked for me on the online makecode editor, offline (w10) did not work at first but worked after having it running through the online one first ... I know there are issues with compilation on w10 ... maybe is it related.

@mhamilt
Copy link

mhamilt commented Jan 22, 2020

Is there currently a setup of Operating System, browser, offline / online editor and firmware version to get this to function on a physical micro:bit? Or is this still strictly "simulator only"?

@mhamilt
Copy link

mhamilt commented Jan 22, 2020

Lacking a better place to add any documentation to get this working. Here are some instructions for adding the fork mentioned by @Cybot101 .

Adding Github Repository to Available Extensions

  1. Go to MakeCode
  2. Start a project
  3. From the setup cog, select Extensions
  4. Scroll to the bottom until Want to create your own extension? Log in to GitHub
  5. follow process for generating a token
  6. paste the url for the fork https://github.com/Cybot101/pxt-filesystem
  7. click on result to add

Notes

The intended functionality of having files appear visible when the micro:bit is connected via usb* is not present in the fork. Data can be streamed over Serial and then downloaded as a .csv from there.

* Which is what I assume is the crux of this issue

Tested on:

OS Browser micro:bit Firmware Version
macOS Mojave 10.14.6 Chrome 253

Useful Links

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants