Linux Build - how to connect to the Web Ide

Posted on
  • I've built using these instructions in a linux VM:

    http://forum.espruino.com/comments/5764/­

    git clone https://github.com/espruino/Espruino.git­­
    cd Espruino
    make
    

    The exe spins up:

    root@nodejs ~/Espruino# ./espruino
    Interactive mode.
    Size of JsVar is now 32 bytes
    Size of JsVarRef is now 4 bytes
    Added SIGINT hook
    Added SIGHUP hook
    Added SIGTERM hook
     1v85.1272 Copyright 2016 G.Williams
    
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    

    How do I connect with the Web ide?

    I tried adding the IP of the VM under communications > Connect over Ip Address, however the instance is not found.

    Do you need to set up a virtual com port, or can connect via IP to a Linux instance.

    I'm hoping the VM version will be a lot more snappy for development - especially uploading when developing modules!

  • This works:

    var http = require("http");
    http.createServer(function (req, res) {
      res.writeHead(200);
      res.end("Hello World"); 
    }).listen(8080);
    

    http://192.168.69.12:8080/

    I have checked telnet is not running - well it doesn't answer on :

    telnet 192.168.69.12
    Connecting To 192.168.69.12...Could not open connection to the host, on port 23: Connect failed
    
  • I think @tve made the default telnet port on Linux 2323 - info here

    On Linux you can't create a port below 1000 without admin priviledges, and generally you don't want to have to run Espruino like that.

    Just typing 192.168.69.12:2323 into the port list should do it.

  • Thanks for replying

  • telnet syntax

    telnet [host [port]]
    
  • hmm. nobody home with:

    telnet 192.168.69.12 2323
    
    Connecting To 192.168.69.12...Could not open connection to the host, on ort 2323: Connect failed
    

    or adding to the web ide..

    Also, is this a concern - and what is the cause?
    WARNING: jsnative.c sanity check failed (int-float-int passing)

  • Thanks to @MaBe, it turns out the Makefile had the telnet off by default, need to do a pull request and update!

    BOARD=LINUX
    LINUX=1
    USE_FILESYSTEM=1
    USE_HASHLIB=1
    USE_GRAPHICS=1
    USE_CRYPTO=1
    USE_TLS=1
    #USE_TELNET=1 # enable telnet to have it listen on port 2323 as JS console
    #USE_LCD_SDL=1

    USE_TELNET=1 # enable telnet to have it listen on port 2323 as JS console

  • WARNING: jsnative.c sanity check failed (int-float-int passing)

    root@esp8266-VirtualBox:/home/esp8266/Es­pruino/Espruino# uname -a

    Linux esp8266-VirtualBox 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:18:00 UTC 2015 i686 i686 i686 GNU/Linux`

    root@esp8266-VirtualBox:/home/esp8266/Es­pruino/Espruino# gcc -v

    Using built-in specs.

    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-li­nux-gnu/4.8/lto-wrapper
    Target: i686-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04' --with-bugurl=file:///usr/share/doc/gcc-­4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortr­an,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/­4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0­-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.­5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/­java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-e­cj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
    Thread model: posix
    gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)
    

    Ok on this system:

    root@nodejs ~/Espruino# uname -a
    Linux nodejs 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u3 x86_64 GNU/Linux
    

    root@nodejs ~/Espruino# gcc -v

    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-­linux-gnu/4.7/lto-wrapper
    Target: x86_64-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-­4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc­,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/­4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
    Thread model: posix
    gcc version 4.7.2 (Debian 4.7.2-5)
    

    So I'm wondering if it a gcc version thing?

  • Ahh, thanks for letting me know. I guess I'm not 100% sure if it should be on by default then, since it's a massive security hole if anyone is currently using Espruino and isn't expecting a port to be opened.

    You can always do USE_TELNET=1 make - although that should be documented. Ideally it would be a command-line option.

    For int-float-int passing - that's interesting. It's referring to what happens if you call a function that takes those 3 arguments. It could be an issue with 32 bit x86 - I checked here and it happens on a real system too.

    It's not a huge deal since it's actually pretty rare that particular argument format is used - I doubt you'd notice a problem. If you do come across it, you'll notice that some of the arguments get corrupted, but it won't cause a crash or anything.

    When you post stuff like that up in future, please can you try and surround it in the 3 backticks? As it is, it's a real pain to look through and see what's text you've written and what's command output.

  • I did try to use back ticks, but it went bung, so I removed them!

    I thought I would add now on the iPad, however the character isn't on the keyboard!

    For the Linux build is there any other way of loading code via the ide, if there isn't - that's why I was expecting it to be on by default. Can it be called a security hole if it's not on a default port?

    As you say documenting makes all the difference!

    I updated the gcc compiler on the 32 bit system - it made no difference

  • I did try to use back ticks

    You probably need an empty line before and after - markdown is a pain like that!

    For the Linux build is there any other way of loading code via the ide,

    Kind of. You can set Linux up such that Espruino auto-runs and is accessible using a telnet server - There was a post on the forum about it. @tve only added the internal server relatively recently.

    Can it be called a security hole if it's not on a default port?

    I imagine so, yes. If I could port-scan your PC and then access it remotely with no password, I think that's something you'd want to fix :)

    IMO the command-line option would be the way to go, and it can be documented in --help and also the Telnet docs I linked in my first post

  • IMO the command-line option would be the way to go

    Agreed

    and also the Telnet docs I linked in my first post

    http://www.espruino.com/Reference#Telnet­
    I guess it's making the association that the Telnet server implementation is what the web IDE is using, perhaps that could be spelt out.

  • I wanted to use the telnet service on linux to run some tests (I think it was to make sure that the service wasn't tied to anything specific in the esp8266), so I made the changes necessary to be able to enable it, but I didn't want to open up the port in general given the security issues.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Linux Build - how to connect to the Web Ide

Posted by Avatar for Wilberforce @Wilberforce

Actions