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

Energy Harvesting doesn't work with RPL protocol #2

Open
khabid opened this issue Jun 2, 2020 · 32 comments
Open

Energy Harvesting doesn't work with RPL protocol #2

khabid opened this issue Jun 2, 2020 · 32 comments

Comments

@khabid
Copy link

khabid commented Jun 2, 2020

Dear Mr Victor,
I tried to add some code to the opt_sched_test but this way the energy harvesting process doesn't work correctly. It doesn't print harvested energy and add it to the battery.
Please help, I'm blocked here for one month.
Thank you

@khabid khabid changed the title Problem implementing EH Energy Harvesting doesn't work with RPL protocol Jun 7, 2020
@victorcionca
Copy link
Owner

Hi @khabid ,

Sorry for the delay.
First, with regards to using RPL and the energy harvesting I think the problem might be that when RPL is enabled the IP stack is used. This in turn takes control over the uart that is used to communicate EH values over the serial sockets from Cooja.

Can you check your contiki-sky-main.c and look for uart1_set_input... followed by serial_line_init...? They should be surrounded by a pre-processor conditional for IPv4 or IPv6 NETSTACK. Try to remove that conditional (or you can replace it with your own macro if you want). I think that this will break the RPL border router because it uses the same uart to communicate over the serial line (SLIP). But you shouldn't need EH on the border router anyway.

For the changes made to opt_sched_test, can you please paste them in your message so I can check?

Regards,
Victor

@somnathmid
Copy link

Dear Mr Victor,
I am trying to work with the code given by you. I have paste the folder eh_contiki under Home folder. But when I am going to run the file optsched_test.c file I am getting the Makefile error. How to avoid that. I think I have done some basic error. Where to put the folder exactly. Can you please guide me?
Thank you

@victorcionca
Copy link
Owner

Hi @somnathmid ,

Did you set the CONTIKI variable in the Makefile? You must set it to the path to your Contiki installation.

Regards,
Victor

@somnathmid
Copy link

somnathmid commented Nov 30, 2020 via email

@somnathmid
Copy link

somnathmid commented Dec 4, 2020 via email

@somnathmid
Copy link

somnathmid commented Dec 4, 2020 via email

@somnathmid
Copy link

I have uploaded the folder directly under HOME. What to do ?

@somnathmid
Copy link

Now code is running optsched_test.c is running but fatal error is coming eh_sim.h no such file it is telling

@somnathmid
Copy link

somnathmid commented Dec 4, 2020 via email

@somnathmid
Copy link

Capture 3
I am getting this error

@somnathmid
Copy link

Capture 1
When i run directly the .csc file I am getting this

@somnathmid
Copy link

Capture 4

I change the Make file lke this and put all all the folder from app to the core folder

@somnathmid
Copy link

Capture 5

Change the .c file by changing the path of header file

@somnathmid
Copy link

Sir, I am waiting for your suggestions

@somnathmid
Copy link

Capture22
Undefined reference it is showing

@victorcionca
Copy link
Owner

Hi @somnathmid
Can you please compile the example straight in the command line and share the log of the compilation?
Don't forget to clean first so any objects left from previous attempts are cleaned.
Also:

  • what Contiki are you running? legacy or NG? This was developed on legacy so I'm not sure if it works on NG
  • what is the path to your Contiki folder?
  • what is the path to this repository (that includes the apps and examples folders)?

Thanks,
Victor

@somnathmid
Copy link

Capture22
I am using InstantContiki2.7

@somnathmid
Copy link

Capture22

I think the path you can understand now, Thanks, waiting for suggestions

@somnathmid
Copy link

Hi, Your code is running, Thanks a lot I got sum result

@somnathmid
Copy link

But I am not able t run .py file . How to do that ?

@victorcionca
Copy link
Owner

Hi @somnathmid
Based on the screenshots above it looks like you've copied the apps and examples folders straight into the contiki folder, which should be fine. However, you still have to configure the CONTIKI variable in the Makefile, which it looks like you haven't done, based on the two screenshots. CONTIKI should be "../.."

You say you got some results. The python energy source simulator should be started before you run the CSC.
How did you run it and what error did you get. Did you follow the instructions in the README file of the python tool?

Victor

@somnathmid
Copy link

Capture
I am getting this after executing the command. What to do ?

@somnathmid
Copy link

Capture

Java stack trace error is coming

@somnathmid
Copy link

.csc file is running but from python eh_source_server.py <shader.pickle> i am not getting change

@somnathmid
Copy link

How to get EH can you please guide

@somnathmid
Copy link

Capture
Some new errors are coming while executing test.csc

@somnathmid
Copy link

How to start python energy source simulator

@somnathmid
Copy link

Capture

@somnathmid
Copy link

Capture 1

Am I getting the output rightly ?

@somnathmid
Copy link

Capture

Only I am getting this, I don't know may be due to server connevtivity

@victorcionca
Copy link
Owner

Hi @somnathmid

You need to use a trace of harvested energy data.
I just uploaded one in the "sim_eh_source" folder, it is called "columbia_irr_only_no_gaps.csv".
I also uploaded a shader file. This adds shadows onto the deployment area

You must run the eh_source_server.py as follows:
python eh_source_server.py 60000 columbia_irr_only_no_gaps.csv 0 test_shaders.pickle

You can drop the test_shaders.pickle from the command line in which case the shadows will be randomly generated.

First run the python script and then run the Cooja CSC file. When Cooja starts the python script will connect to the Cooja serial sockets that are defined in the CSC (with the TCP port numbers starting at 60000, if you haven't modified their values).

In the Cooja log you should periodically see, for each node, "Harvested X", which means that the node harvested some energy.

Let me know how it works.

Best regards,
Victor

@somnathmid
Copy link

somnathmid commented Jan 4, 2021 via email

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

No branches or pull requests

3 participants