pxt-microbit icon indicating copy to clipboard operation
pxt-microbit copied to clipboard

how to run a server in the LAN?

Open gaoyuear opened this issue 3 years ago • 5 comments

Hi, pxt experts

In our classroom, the computers are in a LAN, but don't connect to Internet. I want to build a pxt-microbit local server in the LAN, and students can connect to this local server to program microbit.

I successfully run a local server on 'localhost', everything looks good (change language, download hex file). Then when I serve it on 0.0.0.0 by 'pxt --serve -h 0.0.0.0', I can open the portal from another computer in the LAN by visiting 'http://server-local-ip:3232', programming and simulation work. But I cannot change the language and download the hex file. It gives 403 error. There is another thread talked about the 403. https://github.com/microsoft/pxt-microbit/issues/1925

So is there a way to setup a server serving for LAN? Thanks

gaoyuear avatar Jul 05 '22 16:07 gaoyuear

We provide offline app for these scenarios: https://makecode.microbit.org/offline-app Does that work?

abchatra avatar Jul 05 '22 17:07 abchatra

There are some drawbacks of the offline app in my case, we are volunteering the program education for the schools in the mountainous areas remotely.

  1. their windows version is probably old, that lots dependencies might needed.
  2. the local teacher doesn't have the skill to install it.
  3. there might be disk recover card in the computer.
  4. local teacher has to maintains 20+ computers

I plan to run the pxt server on a ARM embedded box, like Amlogic 905D chip + 2G RAM + 8G ROM, under Armbian. I'm not sure whether the CPU is powerful enough. If it successes, we could send them a box, and they can program in the browser locally. This solution doesn't need any maintenance from the local teacher.

gaoyuear avatar Jul 05 '22 23:07 gaoyuear

Just to clarify there is no installation of dependency is required other than double clicking on the exe for the offline app. It is essentially website wrapped in a electron.

I don't have experience in LAN settings though.

abchatra avatar Jul 06 '22 05:07 abchatra

Offline app fits in a USB drive as well.

abchatra avatar Jul 06 '22 05:07 abchatra

Glad to know there's no dependency of the offline app. But that still needs the local teachers to install them on very computer. And this is not feasible if they have disk recovery card (will restore the system to the snapshot after reboot) in the computer.

Just curious, there are several sites of MakeCode listed in the doc https://makecode.microbit.org/ https://arcade.makecode.com/ https://makecode.adafruit.com/ https://minecraft.makecode.com/ https://makecode.mindstorms.com/ https://makecode.chibitronics.com/

Why there's no tutorial of how to setup a site like it?

gaoyuear avatar Jul 07 '22 03:07 gaoyuear

We host these websites.

abchatra avatar Mar 12 '23 06:03 abchatra