element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Forget Me Not Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Forget Me Not Design Challenge
  • More
  • Cancel
Forget Me Not Design Challenge
Blog Forget Me Not :  eLDERmon  GNUplot
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: mcb1
  • Date Created: 5 Sep 2014 12:59 AM Date Created
  • Views 808 views
  • Likes 0 likes
  • Comments 0 comments
  • forget_me_not
  • b+
  • design_challenge
  • openhab
  • iot_eldermon
  • raspberryp
  • tektronix
  • eclipse
  • internet_of_things
  • enocean
  • smarthome
  • challenge
  • iot
  • enocean_pi
Related
Recommended

Forget Me Not :  eLDERmon  GNUplot

mcb1
mcb1
5 Sep 2014

Forget Me Not :  eLDERmon GNUplot

 

In my last post I talked about Hacking some existing hardware ... namely a commercial Wireless Temperature sender.

 


Link to other posts
Forget Me Not : eLDERmon Intro
Forget Me Not :  eLDERmon  Electrical
Forget Me Not :  eLDERmon  Outlets
Forget Me Not : eLDERmon Planning
Forget Me Not : eLDERmon Parts 1
Forget Me Not :  eLDERmon  Sponsor Parts
Forget Me Not : eLDERmon Hardware Hacking
Forget Me Not : eLDERmon GNUplot
Forget Me Not: eLDERmon Protocol
Forget Me Not : eLDERmon Hardware Hacking #2
Forget Me Not : eLDERmon Hardware Hacking #3
Forget Me Not : eLDERmon OpenHAB


Data Collection

I eluded to collecting data from the Temperature sender by using a Logic Analyser.

Last year I brought a Saleae 8 while on night shift, and I needed an excuse to use it.

 

I had worked out that saving everything including the data, meant I could open it later and do whatever I wanted ... (didn't need the manual for that)

 

Like most Technical types the instruction manual is really there for when you are absolutely stuck, and I never seemed to have time to explore its uses.

As I was searching for information on the hardware, I ran across this post.

http://lucsmall.com/2012/05/21/gnuplot-for-the-electronics-enthusiast-part-1-visualising-data-from-the-saleae-logic/

 

His idea of plotting the data using the captured information was very useful.

The idea of using this for other things was one reason I decided to see if there was a Windows version.

 

GNUplot home page

 

 

 

Saleae Export

The page talks about exporting a single packet using the T1 and T2 markers.

The idea is to pick the start point and expand the window by scrolling the mouse.

 

Click on T1

image

 

and then drag the green broken line across to the first transition.

If you bring the mouse down to the transition it will snap to it.

image

 

repeat for the T2 set point

image

     The images above don't show the mouse pointer, but you can see the time measurement comes up when you are over the transition

 

 

Finally you need to export each of the packets

I used Packet1.csv through to Packet7.csv

 

image

 

These exports are only the first packet and we will see later you may require to mix this up slightly.

 

 

Data Manipulation

When you export the data from the Logic Analyser, it creates a file of rows with a number and value.

While these are useful, you need to change it into something more genric.

image

I tried the above in a DOS window and the computer resonded with "You idiot" or something equivalent. ( I blame the shift pattern at work)

 

I then realised this was using Linux.

 

So attempting to copy the csv file into Excel resulted in the problem of 65536 rows only (later versions allow 1048576 rows)

 

Back to the search engine to see if there is an equivalent 'cut' command for windows.

After trolling through various suggestions about using this script or these multiline commands, I discovered Cygwin.

 

An Installation later and I now had the abilty to use a Linux type shell.

 

Some of you may be thinking "Why didn't he use the Raspberry Pi", and its a good question.

I wanted something that I could use wherever and with whatever, since it looks like this will be useful for other things along with GNUplot.

 

 

Cygwin

 

image

This opens as a dos style window, but the cut and paste from other windows doesn't work, which means typing in full.

While its designed for windows, it seems to dislike the absolute pathing style C:/abc/xyz and resorting to the linux style of ./abc/xyz didn't work either.

image

A few other attempts to find where you were didn't help either so for anyone following it is under the install/home/user directory.

 

I copied the data files into the directory and then executed the command

cut -d "," -f 2 Packet1.csv | cat -n gnuplot_packet1.txt

 

where the Packet1.csv is the fileneame for the csv export from Saleae and gnuplot_packet1.txt is the file it will create.

image

One advantage of naming files with a number on the end is you press the up arrow and then change the number and press enter.

The resulting files are shown above, and as you can see they aren't exactly small considering the are basically two numbers.

 

 

GNUplot

The next step is plotting the data, and there are few minor differences when you are using windows.

You need to set the directory, and you can use the icon at the top ChDir, which opens as a normal window style dialogue to select your data directory.

(In my case its the cygwin home directory)

image

You need to set the terminal to "windows" with the command

set terminal windows size 1200,400


The rest of the commands work and set various things that are probably documented ... but hey this works so why read it.


I had 7 packets so you need to set this correctly

set multiplot layout 7,1

 

image

Once you enter the multiplot command a second window pops up, and after you enter the plot xxxx it populates with the data.

 

image

The result of all 7 data files.

 

 

Data Manipulation

Once you have the plot you can export it, or dump it into clipboard.

What I was interested in was some comparisons

 

You can turn off the various plot lines using the little sissor icons

(sorry they don't rearrange), but this alone helps remove the clutter.

 

image

This shows packet 1 and 2 are the same

 

image

However packet 2 and packet 3 have differences

Packet 3 byte 24 is extra while the one between 34 and 35 is missing.

 

image

Packet 4 has a slight timing change, but you can start seeing differences in each packet.

 

 

Protocol

Now that we have the various Packets, its relatively easy to see that the first 21 or 22 transitions are the same.

It should be noted that this is only the first packet, and there were quite few other packets.

 

It was also done is a stable climate with the temperature and humidity steady.

 

What I need to do next is to measure some of the other packets, to see the full pattern.

Once that has been done we might be able to identify the protocol for this piece of hardware.

 

 

In the meantime i have some other hardware to put together and start getting data into Openhab.

 

 

Mark

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube