Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Contiki 3.0 #20

Closed
ycwuaa opened this issue Feb 7, 2017 · 6 comments
Closed

Compatibility with Contiki 3.0 #20

ycwuaa opened this issue Feb 7, 2017 · 6 comments

Comments

@ycwuaa
Copy link

ycwuaa commented Feb 7, 2017

Thank you for your help :)

@ycwuaa ycwuaa changed the title Help Wanted - Help Wanted - Contiki 2.7 compatibility Feb 7, 2017
@dhondta dhondta changed the title Help Wanted - Contiki 2.7 compatibility Contiki 2.7/3.0 compatibility Feb 8, 2017
@dhondta
Copy link
Owner

dhondta commented Feb 8, 2017

I fixed a bug the make command. Normally, a simulation/campaign can be made without error. run is not tested yet.

@dhondta dhondta changed the title Contiki 2.7/3.0 compatibility Compatibility with Contiki 3.0 Feb 8, 2017
@dhondta
Copy link
Owner

dhondta commented Feb 9, 2017

Note that I added an ´update´ command to make it easier to either update Contiki-OS as well as RPL Attacks Framework.

@dhondta
Copy link
Owner

dhondta commented Feb 11, 2017

Test Environment:

  • Ubuntu 14.04 LTS
  • Contiki-3.x-2370
  • OpenJDK 7

Status: successful

user@instant-contiki:rpl-attacks>> run_all sample-attack.json
2017-02-11 14:55:34 rpla[10135] INFO PROCESSING EXPERIMENT 'test'
user@instant-contiki:rpl-attacks>> status
┌Status of opened tasks────────┬──────────────────────────────────────────┐
│       Task      │   Status   │                  Result                  │
├─────────────────┼────────────┼──────────────────────────────────────────┤
│ test[run]       │ PENDING    │ Not defined yet                          │
└─────────────────┴────────────┴──────────────────────────────────────────┘
user@instant-contiki:rpl-attacks>> 
user@instant-contiki:rpl-attacks>> 
user@instant-contiki:rpl-attacks>> 
┌Status of opened tasks────────┬──────────────────────────────────────────┐
│       Task      │   Status   │                  Result                  │
├─────────────────┼────────────┼──────────────────────────────────────────┤
│ test[run]       │ SUCCESS    │ No result                                │
└─────────────────┴────────────┴──────────────────────────────────────────┘
user@instant-contiki:rpl-attacks>> versions
2017-02-11 14:57:24 rpla[10135] INFO CHECKING VERSIONS
2017-02-11 14:57:24 rpla[10135] WARNING Contiki-OS: 3.x-2370-ge3d5b74
2017-02-11 14:57:24 rpla[10135] WARNING RPL Attacks Framework: 1.1.2-13-gdbe7986

@dhondta
Copy link
Owner

dhondta commented Feb 11, 2017

Test Environment:

  • Ubuntu 14.04 LTS
  • Contiki-3.x-3153
  • OpenJDK 8

Status: failed

user@instant-contiki:rpl-attacks>> run_all sample-attacks.json
2017-02-11 14:32:25 rpla[2200] INFO PROCESSING EXPERIMENT 'test'
user@instant-contiki:rpl-attacks>> status
┌Status of opened tasks────────┬────────────────────────────────────────────┐
│       Task      │   Status   │                   Result                   │
├─────────────────┼────────────┼────────────────────────────────────────────┤
│ test[make]      │ SUCCESS    │  No result                                 │
│ test[run]       │ FAIL       │ ValueError: min() arg is an empty sequence │
└─────────────────┴────────────┴────────────────────────────────────────────┘
user@instant-contiki:rpl-attacks>> versions
2017-02-11 14:35:22 rpla[2200] INFO CHECKING VERSIONS
2017-02-11 14:35:22 rpla[2200] WARNING Contiki-OS: 3.x-3153-g263af6f
2017-02-11 14:35:22 rpla[2200] WARNING RPL Attacks Framework: 1.1.2-13-gdbe7986

Cooja seems to fail because of a plugin, meaning that the simulations crash very early before making the expected results, thus resulting in an error in the parser.

I must still investigate to fix this compatibility issue.

@dhondta
Copy link
Owner

dhondta commented Feb 14, 2017

Diagnostic: Neither Contiki-OS nor RPL Attacks Framework is the problem ; it seems that Rhino Javascript Engine was replaced by Nashorn JavaScript Engine in Java 8 and that importPackage (present in simulations' script.js) is not supported anymore and throws an error at Cooja's startup.

Solution: See templates/experiment/script.js, this line was added at the beginning for Rhino code support (still works with previous JDK versions) :

try { load("nashorn:mozilla_compat.js"); } catch(e) {}

References:

@dhondta
Copy link
Owner

dhondta commented Feb 14, 2017

Cooja error is now handled in run command (see commit e77dc5f) ;

user@instant-contiki:rpl-attacks>> run_all sample-attacks.json
2017-02-14 12:55:37 rpla[3028] INFO PROCESSING EXPERIMENT 'test'
user@instant-contiki:rpl-attacks>> status
┌Status of opened tasks────────┬──────────────────────────────────────────┐
│       Task      │   Status   │                  Result                  │
├─────────────────┼────────────┼──────────────────────────────────────────┤
│ test[run]       │ PENDING    │ Not defined yet                          │
└─────────────────┴────────────┴──────────────────────────────────────────┘
user@instant-contiki:rpl-attacks>> 2017-02-14 12:55:51 rpla[3036] ERROR Cooja error:
FATAL [Thread-1] (LogScriptEngine.java:317) - Script error:
<eval>:2 ReferenceError: "importPackage" is not defined
	at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
	at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)
	at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)
	at jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1441)
	at jdk.nashorn.internal.scripts.Script$Recompilation$1$40$\^eval\_.run(<eval>:2)
	at jdk.nashorn.javaadapters.java.lang.Runnable.run(Unknown Source)
	at org.contikios.cooja.plugins.LogScriptEngine$4.run(LogScriptEngine.java:300)
	at java.lang.Thread.run(Thread.java:745)
2017-02-14 12:55:51 rpla[3036] WARNING Cooja failed to execute ; 'run' interrupted (no parsing done)

┌Status of opened tasks────────┬──────────────────────────────────────────┐
│       Task      │   Status   │                  Result                  │
├─────────────────┼────────────┼──────────────────────────────────────────┤
│ test[run]       │ FAIL       │ Exception: Cooja failed to execute       │
└─────────────────┴────────────┴──────────────────────────────────────────┘
user@instant-contiki:rpl-attacks>> 
``` #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants