Hello, I am trying to work on a project and I’ve found some difficulties using Blynk to read values that come from an Analog to Digital Converter (ADC) ADS1115.
I am using Raspberry Pi 3 Model B and my target platform is Android. I have the newest Blynk Library version installed and I even succeeded to make an LED light up using Blynk (the LED connected on a breadboard to my RPi). My problem is after I’ve done testing Blynk and it worked out fine, I am having a problem reading the value of the ADC inputs. I am not sure how to do it, I was told the SCL/SDA (connected to pin 2 and pin 3 on the RPi) somehow multiplex the values of analog inputs 0, 1, 2 and 3 and they’d be displayed on either SCL or SDA. However, I tried many widgets on Blynk to try and display these values like the numeric value but it didn’t show up anything but “High” the whole time no matter how much I changed it.
My aim is to display an ECG signal that should be read from the ADC. So I figured I need to use the Superchart widget but I can’t seem to get it work on the ADC. The Superchart worked for the light bulb (being on and off was shown in the plot). However, it doesn’t show anything for the ADC pins 2 or 3 (stays 0 the whole time no matter how many different combinations of A0-A3 I tried).
To make sure that the ADC is not faulty, I tried the Adafruit guide for the ADS1115 and the python code, and it worked fine, the values were displayed in real time on the RPi (even if it was trash values, it still worked).
I am not sure about what do I need to do. I didn’t alter anything in the “main.cpp” file.
TL;DR:
I want to read values from the ADS1115 ADC and display it on a Superchart on Blynk.
Blynk will NOT directly read the sensor, so you will need to first get your code working and properly showing data, at least on the terminal monitor or something.
With the RPi, your best language options are NodeJS and possibly Python as then the compatible Blynk library can be used alongside to hopefully send the final data to the App for display.
Look at the link I provided, particularly the python library, add the Blynk python library and connection commands to your sketch and get that working at least. Then instead of… or as well as… displaying your data via whatever method used now, you use the python version of the Virtual Write command.
E.g. blynk.virtual_write(3,'Hello World') # Print text to Display Widget on V3
So I tried installing the Python version of Blynk, and when I try to run the code (shown below) or any other python code that uses Blynk (like the one in the examples of the library) the server starts then shuts down immediately the pictures after the code explain what I mean, I don’t know what’s the problem because in CPP I didn’t have this problem.
I have no idea… but it does seem we are running different versions of Blynk Python, based on the internal messages provided with the logo, mine must be slightly older? Whether that has any bearing??
I made slight changes to account for my Local Server…
However, FYI, in another topic I ran into issues configuring Blynk Python ver.0.2.0 with my Local Server IP. Not sure if there is a different way to do it (from ver.0.1.3), or simply due to my method of “upgrading” from ver.0.1.3 (AKA simply copy/pasting the ver.0.2.0 Blynklib.py over the older one )
Thanks for the git clone suggestion… something new learned… now retain it I must
Just like I didn’t remember/think about the whole “edit the library” thing. But in my defence, I like the option of flipping back and forth between servers from a simple sketch edit.
@Costas@Gunner Even the cloned version on my RPi gives the same result, and they all seem to be version 0.2.0 for me. It just terminates immediately after starting.
@Costas
After installing that version here’s what happens. I tried different example folders:
And when I tried to run my own examples shown in the previous reply, this happens:
So the old version is uninstalled, I used pip unsintall, and used sudo python setup.py install on the 0.1.3 version. The resutls are shown above. Any idea what’s the problem?
EDIT: Note that I had to manually stop the terminal using CTRL+C because it was going like that forever. Connecting and disconnecting.