ESP8266, WEMOS D1mini, HotSpot feature Webthing issue

Issue #96 resolved
Turgut Guneysu created an issue

When a Hotspot is created (192.168.4.1), and the PC is connected to it, the SNAP! and Browser exchanges do not show correct info depending on the WebThing Library blocks use order.

I have provided two pics below documenting what I mean:

First sequence of blocks, generate the shown browser display. I have also taken this JSON and put it through a JSON Viewer to make its layout easier to see.

There is YELLOW highlighted JSON entry in the properties that I could not figure out what it was for.

After the IP address display, if I type in the browser

http://192.168.4.1/events

I get the display:

[
    { "_":{}}
]

I was expecting a bit more meaningful of a display, with the declared event button info.

Now let’s look at the same thing with a different order of blocks:

This time the JSON entry is all botched up, I think:

  • properties group shows no entries for the variables declared - YELLOW highlight
  • all property entries are displayed under the events group, in addition to the valid button event.

Comments (4)

  1. John Maloney repo owner

    Thanks for this very thorough bug report. Looks like there are at least two bugs here.

    As Bernat suggested in another issue, it would be much easier to fix bugs in the Web of Things system if the server were written in MicroBlocks itself. Bernat is working on that.

  2. Turgut Guneysu reporter

    Quick Question:

    microBlocks in HOTSPOT mode: is the web thing server supposed to answer events generated in SNAP, for example?

    Or is the SNAP to microBlocks interaction only limited to changing variables?

    I did a sample code, but could not figure out how to generate EVENTS from SNAP to mB.

    Given the setup at the top of this issue, I used a “msg” variable, and transmitted it with the desired message (BUTTON) in it, and checked for content on the mB side. Very crude, but worked.

    Of course, I am hoping that when Bernat’s work is done, events will be possible?

  3. John Maloney repo owner

    I don’t believe the MicroBlocks VM yet supports incoming “events”. It shouldn’t be hard to add them, especially once the server side is written in MicroBlocks. But it might take a while to get there so I’m glad you have a work-around.

  4. Log in to comment