Problem with HTTP server on microbit

Issue #202 resolved
Simon Walters created an issue

I just updated to 1.0.10 on a working install that was using the webserver to get info from Snap! and it stopped receiving data

When I went to check my Snap! script,instead of previously getting a JSON string in return I’m now getting this

Comments (7)

  1. Bernat Romagosa

    Hi, Simon.

    We’ve removed the WebThings server in the latest versions of MicroBlocks because it was causing a lot of confusion. We had the WebThings server integrated in the IDE, but also a WebThings library for network-capable boards, and a lot of users were getting confused between the two (and to be honest, we’ve been bitten ourselves by the confusion once or twice too!).

    The IDE still has an HTTP server, though. You can check out its usage documentation by starting it and visiting http://localhost:6473/

    Here it is:

    MicroBlocks HTTP Server
    
    / - this help text
    /getVar/URL_encoded_var_name - get variable value
    /setVar/URL_encoded_var_name/value - set variable value
      (value is: true, false, an integer, or a URL-encoded string (up to 800 bytes))
      (double-quote strings that would otherwise be treated as a boolean or integer such as "true", "false", or "12345")
    /broadcast/URL_encoded_message - broadcast message to board
    /getBroadcasts - get broadcasts from board, (URL-encoded strings, one per line)
    
    Lists and byte arrays are not supported, although getVar reports them as they would be shown by the "say" block
    

    I hope this answers it 🙂

  2. Simon Walters reporter

    I always like little surprises 🙂 Good job I checked before I published my tweet on how to use it :)

  3. Bernat Romagosa

    No problem! Thanks for all your publicity on Twitter! I’m loving your fancy LED ball project!

    (Marking this one as resolved)

  4. Simon Walters reporter

    One thing - the new way of setting a variable doesn’t produce any return value like it used to - is that a deliberate design decision or a missing feature?

  5. Log in to comment