I would assume many makers are familiar with using a logic analyzer in conjunction with sigrok + pulseview. I love these resources. They allow you to analyze precisely what is happening on your digital IO pins on whatever microcontroller you are using whether it be arduino, raspberry pi, etc. They can also analyze signals at the protocol level such as i2c and are so inexpensive every maker should be equipped with these tools.
I do not like to reinvent the wheel in most cases. I wanted to use some dht22 temp / humidity sensors on an RF signal strength project I am still working on. As I have mentioned in earlier posts, I chose to use the RPi::PIGPIO::Device::DHT22 module on cpan to read my sensor. This required the pigpiod daemon to be running on the raspberry pi. I am very impressed with PIGPIO. It allows you to very easily read / write to a raspberry pi ‘s GPIO lines over TCP/IP. Just think of the possibilities.
The author of PIGPIO also offers an incredible logic analyzer for the raspberry pi called piscope. I may never use a standard logic analyzer on a pi ever again. You can invoke piscope on any linux computer once you have installed it to analyze the gpio on a remote pi.
After this, launch piscope:
I am just beginning to experiment with piscope, but so far it is very user friendly. This is a trace of the SDA and SCL lines on the pi reading an MCP9808 temperature sensor.
This trace was taken over the net. I didn’t have to get out my logic analyzer and connect any test leads. Here is a trace of a poll and response from a dht22 sensor connected to gpio 24.
You can see it go low, then the sensor sends its reading, and goes high again. pigpiod is definitely a resource hog, but that is hardly a consideration for my uses of the pi in my projects. I will definitely be incorporating piscope into my future projects.
piscope by default uses port 8888 on the pi you are monitoring. Out of curiosity, I scanned the incoming frames with tcpdump.
It sends a lot of traffic over the network.
Here is a video of me launching piscope, and live traffic from a pi 3B+.