Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
.gitignore
build.sh
mspsim.js.zip
proiot.patch
readme

readme

1) java -Djava.awt.headless=true -jar mspsim.js.jar [9148] [0.0.0.0]

2) Options:
    - Remove -Djava.awt.headless=true to enable UART UI
    - Play with -Xmx256m to avoid OutOfMemoryError if machine is low on memory (RAM < 1g)
    - Add -XX:-OmitStackTraceInFastThrow for better loging

3) Very basic examples for 1) or 2):
    - about: http://localhost:9148/help.html
    - anime: http://localhost:9148/21e726e95d4509f26e42ef63420284e2
    - snake: http://localhost:9148/a492eba288cddc9309cbeb83900b0a21

4) IPv4:

    a) Configure virtual network (you can change 10.0.0.1):

      - Linux:
        # sudo ip tuntap delete mazko mode tap
        sudo ip tuntap add mazko mode tap user $USER && \
        sudo ip addr add 10.0.0.1/24 dev mazko && \
        sudo ip link set dev mazko up

      - Windows:
        # install Tap-windows driver from OpenVPN site
        # Start -> Control Panel -> Network Connections then rename "TAP-Windows Adapter" to mazko
        netsh interface ip set address mazko static 10.0.0.1 255.255.255.0

    b) Quick test for virtual network (you'll see output containing the ICMP frame):
        java -cp mspsim.js.jar se.sics.mspsim.platform.proiot3.TunTapImpl
        ping 10.0.0.255

    c) Share an Internet Connection:

      - Linux (assuming wlo1 is connected to the internet):
        sudo sysctl -w net.ipv4.ip_forward=1
        sudo iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o wlo1 -j MASQUERADE
        sudo iptables -A FORWARD -i wlo1 -o mazko -j ACCEPT
        sudo iptables -A FORWARD -i mazko -o wlo1 -j ACCEPT
        # ping -I 10.0.0.1 google.com

      - Windows:
        # Start -> Control Panel -> Network Connections
        # then right-click on the icon that represents your connection to the internet
        # then left-click on "Properties" -> "Sharing" -> 
        # "Allow other network users to connect through this computer's"
        # Verify virtual network ip address a)
        # b) ping -S 10.0.0.1 google.com

    d) DHCP:

      - Linux:
        sudo dnsmasq --interface=mazko --bind-interfaces --dhcp-range=10.0.0.2,10.0.0.254,15m

      - Windows:
        # install Open DHCP Server from http://dhcpserver.sourceforge.net/
        # Start Menu -> DHCP Server -> Configure -> DHCPRange=10.0.0.2-10.0.0.254
        # Start Menu -> DHCP Server -> Configure -> DomainServer=10.0.0.1
        # Start Menu -> DHCP Server -> Configure -> Router=10.0.0.1
        # Start Menu -> DHCP Server -> Run Standalone

    e) ENC28J60 examples for 1) or 2):

      - NTP clock: http://localhost:9148/dff936a1cd1a6317c7055e0f6fab4a6d

5) IPv6:

    a) Configure virtual network:

      - Linux:
        # sudo ip tuntap delete mazko mode tap
        sudo ip tuntap add mazko mode tap user $USER && \
        sudo ip link set dev mazko up

      - Windows:
        # install Tap-windows driver from OpenVPN site
        # Start -> Control Panel -> Network Connections
        # then "TAP-Windows Adapter" Properties -> check ipv6

    b) Quick test for virtual network (you'll see output containing the ICMP frame):
        java -cp mspsim.js.jar se.sics.mspsim.platform.proiot3.TunTapImpl
        ping6 ff02::1%mazko

    c) Share an Internet Connection:

      - Linux (assuming Hurricane Electric Free IPv6 Tunnel Broker is used):
        # ping6 ipv6.google.com
        # Routed /64 as listed on tunnelbroker.net Tunnel Details page (without the trailing ::/64)
        ROUTED64=2001:470:aaaa:bbbb
        sudo sh -c "
          sysctl -w net.ipv6.conf.all.forwarding=1
          sysctl -w net.ipv6.conf.default.forwarding=1
          ip addr add $ROUTED64::1/64 dev mazko
          echo '
          interface mazko
          {
              AdvSendAdvert on;
              MaxRtrAdvInterval 10;  # TODO: maybe contiki bug
              AdvOtherConfigFlag on; # clients get extra parameters via DHCPv6
              prefix $ROUTED64::/64
              {
                AdvOnLink on;
                AdvAutonomous on;
              };
              RDNSS 2001:470:20::2 {}; # Hurricane Electric DNS
          };' > /etc/radvd.conf
          service radvd restart"
        # sudo radvdump

      - Windows:
        # TODO: 4) c) didn't work out for me, but You can become a hero and fix this !

    d) ENC28J60 examples for 1) or 2):

      - NTP clock: http://localhost:9148/874a5876ab802c27d73669ab067df678

6) IoT 🏠 🚗 🚸 http://mazko.github.io/ 📻 💡 🔊