Measure the battery level on ns-3 - ns-3

I am trying to build a MANET on NS-3. Is it feasible to measure the batteries of the wireless nodes and calculate the energy consumption? Can I use other standards, like Bluetooth, Zigbee, LoRA again by measuring the battery? So for example start the simulation using WiFi/Bluetooth/Zigbee/LoRA with the nodes having 100% battery, and with the use of trnasmition/receiving packets, to measure when the battery goes lower..70%, 30% ?

Yes, ns-3 has a module for working with energy consumption, it's in src/energy. Already having some power consumption models implemented:
Rakhmatov Vrudhula non-linear battery model
Model a generic Lithium Ion Battery
Linear model
You can look at some examples of how to implement the templates in src/energy/examples. Recalling that ns-3 has no proprietary technology modules like ZigBee and Bluetooth, it currently implements a common communications module LR-WPAN based on the IEEE 802.15.4 standard.
There is also an unofficial LoRaWAN module that works on ns-3.

Related

LoRaWAN Coverage Design in Rural Areas

I need to cover a district with a LoRaWAN network for air quality sensors. I know that the LoRa/LoRaWAN technology is the perfect solution when Line of Sight is maintained, but is there any easy way to determine how many gateways are needed in rural areas? I amning plan to use Kerlink Wirnet iStation V1.5 as gateway and ESP32-based CO2 sensors. Many thanks in advance.
You definitely don't need line of site for LoRa communication.
The easiest, and most accurate way to estimate the number of required gateways is to do a field test with one single gateway and a test device (e.g.: an Adeunis Field Tester). This way you can check what the longest distance between an end device and the gateway can be. Using that information you can calculate the required density of base stations.
If you register for a free account on Actility's ThingPark Community Portal and you connect your Kerlink gateway to the ThingPark Network Server, you will be able to use Actility's Network Survey Tool that can visualize the coverage of your gateway an a map.
If you want to make a rough estimation I would say that in a rural environment, where devices are outdoor and the gateway antenna is on a 20m height pole or on top of a 20 height building the range of a gateway is around 1-3 km. If the end devices are indoors (in rooms having windows) this range is 0.5-1.5 km.
You could also use The Things Stack community edition (formerly known as TTN, The Things Network) in conjunction with ttnmapper.org. Note that there is currently a transition going on from TTN (V2) to The Things Stack V3, see the notice on the webpage. This method uses field tests similar to the system proposed in Norbert Herbert's answer; any simple node is sufficient because the GW's metadata are evaluated. You can track you field test live on a smartphone. As LoRaWAN coverage strongly depends on the gateway's placement, it should be at least similar to the intended position, better be the planned position proper.
For a dry run without any hardware, you may also have a look at the freeware program Radio Mobile by Roger Coudé VE2DBE, with more info by Remko Welling PE1MEW here. The program lets you simulate radio connections in a wide variety of settings, including a complete mapping of a region with multiple gateways.
Line of Sight is not always needed. There are many factors that will affect the reach of your modules, including the terrain (hills can get in the way, especially higher ranges), the settings you would use for your LoRa or LoRaWAN network, and where you position your gateway(s) – when using LoRaWAN – or transceivers, when using LoRa.
I live in a mixed environment, half hills and jungle and half dense, high rises, and I get about 10 km coverage, no LoS, and more if I get LoS from a height, both with LoRa and LoRaWAN, although reliability is not always guaranteed.
But first you have to decide whether you will go the LoRa or the LoRaWAN – this has implications on both the hardware and software budget: while LoRaWAN requires more equipment, and more onerous, it will simplify the setup cost, software-wise. I am very much a LoRa guy myself, but I do recognize the benefits of LoRaWAN for quick developments.
But it'd be cheap to do a first test with a couple of LoRa devices, to check how far you can reach in your region.

I have a project idea on Smart Lighting System. How can I do the simulation for this?

Currently I am working on this project to provide the layout of a smart street light system with energy saving function based on sensor network for energy management. The proposal is an autonomous-distributed-controlled light system, in which the lights turn on before pedestrians come and turn off or reduce power when there is no one by means of a distributed-installed sensor network.
I will be adding a few things to the project for energy reduction but what I need to know is how do I perform the simulation to show that this approach would reduce energy consumption?

Simulator for Openflow in LTE

I am currently researching on SDN in mobile networks (LTE). for that i am looking for a simulator, need advise.
I have gone through NS3 and it appears as it supports Openflow Switches, but couldn't find documentation for that purpose. Need help in simulating SDN network in LTE. any suggestion/advise would be highly appreciated.
Thanks,
Shahzoob
NS-3 has a module called ofsoftswitch13 which might be quite helpful in your case. It implements controller entity as well as OF 13 protocol.
I did an undergraduate thesis on this topic and used Mininet and Ns-3 together using this project. We primarily did validity testing on this platform to determine it's accuracy and limitations (especially at scale). The wireless model is very good until a very clear performance degradation when the CPU usage reaches (100/n)% - where n is the number of available cores on the machine (for a single threaded implementation).

how to meter power(watt) of PC components(cpu,memory,disk,etc) in real time?

As the question says ,I want to monitor the value of power(watts) that some components consumption .especially the value of CPU , Memory and disk .
when I use aida64,I found that in computer/sensor ,there are some data about power consumption . I want to know how did it can get these data ?
I already have some idea ,but not sure which is the best way to solve this question :
there are some sensors on the motherboard ,we can use values of those sensors to calculate the real-time power.
according to different OS, we have some APIs that can get the utilization of cpu,memory throughout rate and disk I/O rate . Using this data ,we can build mode of power consumption about PC.if there are those APIs,where can I find them ?
maybe the hardware manufacturer like intel has already record the value of power in real-time ,they put the value into some special register in hardware .we can get the value through mapping into special memory location .
In my opinion ,the second way maybe the solution that most monitor software using .but I just don't know where can I get those API.
whats more ,our aim is to design an OS-independent real-time power monitor software. So, if there are any better solutions about this question ,I will appreciate your help .
Hmmm. I wasn't sure if I should post this as a comment or an answer. It is an answer but in the negative.
At this time, you can't create an OS independent software-based non-intrusive power monitor. By non-intrusive, I mean that you are not putting special instrumentation on the motherboard and other hardware. This is because the power technology being used by modern processors is in rapid flux, each new generation making significant advances. Additionally, the amount of power related information available to software from the hardware (via PMU events and the like) is continually increasing as more silicon real estate becomes available. For example, I believe that in the most current processors, you can get direct thermal information for key parts of the processor silicon, and temperature, power and current readings from various parts of the core and uncore.
The best you can do is to abstract the top layer of your monitor from the lower layers. Then the top becomes OS / HW independent while the lower levels need to be platform dependent.
Check out the PAPI APIs. Note that the APIs appear to give you the world, but are really just an API set. Someone still has to implement what's on the other side of the API.
Now if you can do your own special instrumentation, many (most?) motherboards and other hardware have measurement points (some undocumented) that provide thermal, current (and so power) information. This information is important for debugging devices and platforms.

Affordable, programmable device with gprs and simple sensors?

I've got quite a fun challenge / work assignment. I'm to monitor a couple of 5V light bulbs (warning lights) on a machine standing far out in no man's land. I'm looking for an affordable device with an input which allows me to hook into the light bulb circuit to tell whether it's lit or not.
Requirements:
GPRS
Inputs for at least two light bulbs
Programmable in C or something similar.
Bonus (not required, but it would be kind a nice):
Waterproof casing / chassis (I could make this my self, but it would be nice if I didn't have to)
Option to add other sensors like humidity, temperature and gps.
Any tips?
I'd recommend an arduino
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.
Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language (based on Wiring) and the Arduino development environment (based on Processing). Arduino projects can be stand-alone or they can communicate with software on running on a computer (e.g. Flash, Processing, MaxMSP).
there's an article here on hooking one up with gps
http://www.arduino.cc/playground/Tutorials/GPS
and for more information on the arduino platform in general, and where to buy
http://www.arduino.cc/
Edit: just noticed you were looking mainly for GPRS and not GPS - doh, however, quick look on google brings up this: http://www.libelium.com/squidbee/index.php?title=New_GPRS_module_for_Arduino_%28Hilo_-_Sagem%29 which is a GPRS module for the arduino :]
Have you looked at Arduino?
in fact, what you are asking already exists: many companies which produces electrical component for the industry provides a rail-mounted GPRS modem for remote signaling.
here is one example, made by phoenix contact
another one from another company
the tele-control range of product from wago
telit is well-known for its GSM chips, and provides a complete module with GPRS and programmable in python.
you can find some fancier systems including GPS and linux-based, here for example
there are countless other solutions...
I would buy the Terminus from Janus RC it is based on a telit module. It is a cell modem with 9 GPIO and you can program it using python.
Interface
9 Bi-directional CMOS I/Os
Power Monitor
1 ADC
ITU-T V.24 serial link through UART
Python Script Support
Integrated Python script interpreter (V1.5.2+)
2 MB of non-volatile memory
1.2 MB of RAM reserved for Python engine usage
Powerful built-in libraries makes accessing hardware easy