Avatar for opichals

opichals

Member since Jun 2014 • Last active Apr 2018
  • 4 conversations
  • 59 comments

Most recent activity

  • in Projects
    Avatar for opichals

    as you're working in JS you could look at compiling Espruino with Emscripten

    A while ago I played with that idea for a bit. Got to the point where I got the minimum running within node.js but for more it would require some clever work on implementing the JS<->C trampoline properly.

  • in ESP8266
    Avatar for opichals

    @AntiCat Thanks, exactly.

    @SergeP @Gordon I don't think this is a bug but rather a feature that the Espruino cleanInterval() implementation deviates from the specified behaviour by cancelling all scheduled timeouts and intervals rather then doing nothing.

    That said unless we would like to change the behavior to comply to the spec which would break a lot of existing user code done specifically for Espruino (perhaps doable using some sort of deprecation mechanism).

  • in JavaScript
    Avatar for opichals

    @allObjects While putting the credentials into a module is a possible way of 'hiding' it from the application module it still logically doesn't belong there. It forces people using or deriving the application code to have such module as well or to change the code which is not clean.

    There is also security aspect which we might want to think of. The configuration API should be done so that the sensitive information could be stored encrypted in a safe place and not in flash memory (something the BigClown core module would support).

  • in JavaScript
    Avatar for opichals

    @Gordon Thanks for the 'Storage' module! Its use should to be a great way of not having to duplicate the serialization (JSON.stringify should suffice?) and flash access in the jswrap_wifi_save/restore methods. I would still vote for a .wifiauth file (or a more generic .config perhaps?) which would get loaded and wifi connected after every reset independently of the E.setBootCode stuff.

    BTW What would you think of using a leading dot (or perhaps some other character of your liking) in the filename as a nice way of distinguishing internal files.

    Also thank you for the onInit() { on('connected', ...) } note, I haven't noticed that before for some reason.

    @Ollie I somehow didn't spend too much time but I think I could not find a way to pass arguments/env variable values to the espruino npm's cli .js script.

  • in JavaScript
    Avatar for opichals

    I find it quite a good feature of not having to include the SSID and credentials to the actual device code. It doesn't belong there. I use onInit() { wifi.on('connected', function() {}) }.

    I wish I could do something like espruino -e 'wifi.connect($SSID, { password: $PASS }, () => wifi.save()) where I would be prompted to type in the password which would be sent to the board but I have yet to find a way which would not require saving the script to a file first.

  • in Interfacing
    Avatar for opichals

    Finally I got it working. The wiring based on the schematics is as follows

               SHIELD      Espruino
    MOSI   ICSP4          B5
    MISO   ICSP1          B4
    SCK    ICSP3          B3
    CS     JHIGH3 (10)    B2
    3V3    ICSP2          3V3
    GND    ICSP6          GND
    

    The shield worked with 3.3V as well as 5V wiring with level shifters.

  • in Interfacing
    Avatar for opichals

    So I managed to resurrect the Espruino board with serialflash.

    However I didn't have much luck so far with the current master. I tried using 3.3V as well as with level shifters to 5V (according to the shield spec).

    >var eth = require("WIZnet").connect();
    =Ethernet {  }
    >eth.getIP()
    ={
      "ip": "0.0.0.0",
      "subnet": "0.0.0.0",
      "gateway": "0.0.0.0",
      "dns": "0.0.0.0",
      "mac": "00:00:00:00:00:00"
     }
    >eth.setIP({ "ip": "10.0.5.3", "subnet": "255.255.255.0",
    : "gateway": "10.0.5.1", "dns": "8.8.8.8", "mac": "aa:bb:cc:dd:ee:ff"
    : });
    =true
    >eth.getIP()
    ={
      "ip": "0.0.0.0",
      "subnet": "0.0.0.0",
      "gateway": "0.0.0.0",
      "dns": "8.8.8.8",
      "mac": "00:00:00:00:00:00"
     }
    
  • in Interfacing
    Avatar for opichals

    Thank you Gordon! Got it flashing correctly...

    After few experiments though I closed the flashing dialog during a running flash and pressed RST on the board which bricked it. Now I need do learn how to do the serialflash procedure I guess ;)

    So no real W5100 success on my side yet.

  • in Porting to new Devices
    Avatar for opichals

    Hey!

    There is a running campaign for BigClown make kit here https://www.indiegogo.com/projects/bigcl­own-the-iot-kit-for-makers-for-you-diy#/­ .

    Their core module is 19EUR (192k flash, 20k RAM, ARM Cortex M0+ 32-bit MCU STM32L083CZ (ST)... so similar to Olimexino STM32) or 29EUR for the same thing with an RF chip for wireless communication. It all comes with great support, security chip on board, an async API based SDK and a warranty.

    What would you think of porting Espruino to it? Any interest?

    Best Regards
    Standa

Actions