Monitoring data traffic

Hello 

I would like to use an USB modem stick to send my data to EmonCMS. It will be connected to the Raspberry.

Does anybody know of a good Linux tool to monitor data traffic between Raspi and Internet ?

Thanks for your help.

Walter

Robert Wall's picture

Re: Monitoring data traffic

Wireshark?

But it might do far more than you want.

daturach's picture

Re: Monitoring data traffic

Thanks. Yep, that's a quite "serious" tool. Will have a look.

As I said, I would like to send my data using a Modem stick and a prepaid card. I am currently uploading 10 keys on EmonCMS. The modem will be attached to the ppp0 interface for those who are versed in networking. Data are updated every 15 sec.

Does anybody have a rough idea how much data that represent in term of bytes (up and downlink)? I know that depends on a lot of different things. Anyway, maybe someone uses such a system.

Thanks for your help

Walter

 

daturach's picture

Re: Monitoring data traffic

I finally installed a lightweight tool called httpry. This tool allows you to only see the http requests. I did not find any packages for the Raspi. So you have to compile and install it. 

More info here (http://xmodulo.com/sniff-http-traffic-command-line-linux.html)

Basically, you "just" do this on the command line:

sudo apt-get install gcc make git libpcap0.8-dev
git clone https://github.com/jbittel/httpry.git
cd httpry
make
sudo make install 

To run it:

sudo httpry -i eth0 -o capture.txt

You get in the txt file:

192.168.0.16    80.243.190.58    >    POST    emoncms.org    /input/bulk.json?
apikey=YOUR_KEY_HERE
    HTTP/1.1    -    -

There are other options you may want to try and even some PERL scripts as plugins (which I haven't tried).

Walter

 

daturach's picture

Re: Monitoring data traffic

I managed to connect my UMTS/3G USB stick to my Raspi using the ppp0 interface. As I said, I am uploading 10 keys every 15 secs. That's about 7 kB/min which is 420 kB/h or 10.08 MB/day or 302 MB/month !!

I have noticed since I was transmitting with the stick, I lost quite often http packets. I don't know how far are the cells. I just know that this module is limited to 1W of power output. I was able to check that the packets were lost before they were transmitted to the GSM network.

The Raspi is equipped with a RFM69 module (433 MHz band). I am at the limit in term of distance between EmonTx and Raspi. However, I don't have issues when I transmit packets through my Ethernet connection.

I am pretty sure the stick is affecting the overall sensitivity of the RFM module. Well, it's true that both modules are adjacent (20 cm.)

Anyway, I read that someone is reporting data loss due to RF packets getting corrupted. Maybe it's a similar problem.

Walter

pb66's picture

Re: Monitoring data traffic

If using GSM could you not move the Pi to the emonTx location and connect using serial-direct to eliminate the need for local RF? or is there a power supply or other environment issue?  

Or use a usb extension lead to move the dongle away from the Pi?

There is a pretty strong possibility the dongle is interfering with the RFM2Pi if in close proximity, especially if the emonTx signal is weak,

Paul

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.