How to save and send the mote output in contiki - contiki

I am a new o new one to contiki, I refered the contiki website and executed the sample program.
How can I automatically save and send the mote output to a repository..??

Related

Dump of BAMs (Broadcast Announcement Message) with canutils

Good morning,
I'm a embedded linux developer and I'm trying to dump J1939 CAN sentences on a iMX6 based board.
I tried saving RAW canbus messages on a file using the command
candump can0 -L > /tmp/fms_canbus
and everything works fine with NON BROADCAST messages.
However I'm not able to receive BROADCAST messages (BAM), it seems that no BAM message is recorded on the file.
As far as I know, in order to read BAM message, the socket should be opened with option SOCK_DGRAM, CAN_BCM, but it seems there is no CLI tool in canutils package that allows to perform an operation similar to the
candump can0 -L > /tmp/fms_canbus
Is there anyone that can help me fixing this issue?
Should I implement a custom tool or is there a standard utils allowing to perform the desired action?
Best regards
Giovanni

msp430 (telosb) adc driver for mq5 sensor in contiki

I am trying to connect MQ5 sensor to a Telosb and read the values, and i am using contiki os.
My problem now is:
I know that i need an ADC driver in contiki os, but i do not know how to do it or from where to start ?
Can anyone guide me please?
The ADC driver for TelosB is already implemented in Contiki, you can find it in file sky-sensors.c and sky-sensors.h in contiki/platforms/sky.
See light-sensor.c and temperature-sensor.c for examples of sensor drivers that use this "sky_sensor" API. Basically you need to select which ADC input channel to use and what reference voltage to use, the rest is trivial: call sky_sensors_configure function and read from the right memory location mapped to an ADC input port. For example, by reading ADC12MEM4 you can access the ADC channel 4.

Upload data to the TelosB in Contiki

I am a newbie of the Contiki System. I am trying to upload binary data (in
txt. format, it is some recorded interference) to the TelosB node to regenerate
interference (the data file is in large size, 5M for example), in other words, I am trying to use Contiki to read binary files and send to the node. I googled
this problem, but did not found much useful information.
Could anyone give me some idea?
Thank you in advance.
The easiest way to send data from/to your TelosB is to just send it to the tty associated with the USB port it's connected to (e.g., /dev/ttyUSB0). Your TelosB will be able to simply read the data from stdin (and vice versa).

How to grab print content in Print Monitor API & save it to a file?

my requirement:
User click 'Print' button in any software can implement the following jobs:
Save the print job to pdf/jpeg/bmp on hard disk.
Send this print job to the printer and print.
I am just learning the Print Monitor sample in a few days, following the msdn's WDK Port Monitor samples, but I don't know where to grab the print content, acorrding to msdn, port monitor send raw data to kernel-mode port driver,
I know the LcmStartDocPort() calls CreateFile(), LcmWritePort()
calls WriteFile(), it seems these 2 function do the communication to
the "kernel-mode port driver"?
it seems I need grab this raw data & save it to the local disk?
Any suggestion? Thank you!

Sending UDP Packets from Wireshark / tshark

I am working with a "real time" data analysis toolchain which is separated into two parts. The first part fetches the data to be analyzed, packs it into a UDP packet and sends it to another host. The second part, running on the aforementioned host, receives the UDP packets and performs analysis on the received packets. By "real time" I mean that the output of the analysis toolchain should appear live to a human user, thus latencies of up to 100 ms are acceptable.
I am looking into making a new data source available to the receiving part. The data that I am looking for are being transferred on an Ethercat bus, which I can sniff. Wireshark/tshark have a dissector for Ethercat packets. With that said, it's really simple to get at the data in a script running within Wireshark/tshark. Since I have little control over the second part of the analysis, I cannot readily modify the second part to sniff Ethercat frames via pcap or somesuch.
Is it possible to send UDP packets from a script running in Wireshark/tshark?
Wireshark's Lua doesn't have a way to do that available out-of-the-box, but it's stock Lua so you can write a wireshark Lua script which itself can import (i.e., use require) any other Lua script or compiled Lua dll/so library. So, for example, you could use the LuaSocket library to send packets from within your wireshark Lua script.
Note that there is no event loop available to Wireshark Lua scripts, so receiving packets via LuaSocket isn't going to work, afaik. But since you're talking about sending over UDP, and sending only when the Wireshark Lua script will get invoked (i.e., because you'd do the send() call inside a tap or dissector), I think it should work. If it does/doesn't please post back, because this question comes up now and then and it would be good to know.

Resources