I have an arduino writing data to a SD card in a remote location and today and I must remove the SD card, put it in a reader on my laptop to view the data. I would like to know if there is a way if I have the Blynk app on my iPhone I could send a command to the arduino and have the arduino write text lines back to the iPhone ?
Thanks
Read the file and push it to a terminal window?
The general format would be like this.
v1 write // new button
read the file // https://www.arduino.cc/en/Reference/FileRead
print file to terminal // https://docs.blynk.cc/#widgets-displays-terminal
If you write the data to Blynk at the same time as writing it to your SC card (or even instead of writing it to your SD card) then you can retrieve the data from the Blynk server.
How you choose to do that will depend on the nature of the data. If itās numeric, such as temperature or humidity readings, then you could use the Superchart widget to visuaise the data and the Reports widget to download the data for analysis in Excel.
One small word of warning - if youāre using an Arduino with an Ethernet/SD Card shield then itās not possible to use the Ethernet connection and the SD card at the same time. This means disabling the Ethernet connection while accessing the SD card, then re-enabling Ethernet afterwards.
Blynk likes to have a constant connection to the server, so disabling the Ethernet card may not work too well.
The simple answer would be to abandon the SD card altogether, but Iām guessing you might not be too comfortable with that idea, at least at first.
You may get away with disabling the Ethernet connection for very short periods of time, but youād have to test it.
Of course, if youāre using a different type of SD card on different hardware then it wont be an issue.
Pete.
Thank you for the excellent customer service and getting back so quickly, I will review those docs
Jim, you might want to cancel what i said. Pete is right (again!).
Hi Pete
Thank you for the update. The device is in a remote location running on a solar panel so it is out of range from Wi-Fi. That is why I was hoping when I periodically visit device I could use a Bluetooth connection and somehow send a command to the Arduino to show me the last 20 or 30 entries and have it display on my iPhone vs having to remove the SD card and bring a laptop to read the card. Can you recommend a Bluetooth board for the Arduino for this app? Thanks !
Jim
No experience of Bluetooth personally, and I donāt know if what youāre proposing is do-able without a Blynk server. Iām sure someone with Bluetooth experience will chip-in with their thoughts.
Including info about the solar powered device with no Wi-Fi and the desire to use Bluetooth is something that would have been useful up-front.
Pete.
Hi Pete
Thanks for the update and as you probably can tell I have a little experience with these technologies, was assuming the blink app on the phone would somehow talk to a Bluetooth board connected to the Arduino but as you pointed out it sounds like there has to be an Internet connection with the arduino device and a Blynk server acts as a go between the arduino and the iPhone.
Jim
Basically correct.
Blynk uses aā¦
App <- network -> Server <- network -> MCU setup, which is ideal for IoT
The Beta BT/BLE interface use case isā¦
BT/BLE based MCU <- BT/BLE -> App <- network -> Server ( <- network -> MCU optional)
The App generaly always needs to talk to the Server, which typically requires a constant network connection, which allows for network/internet wide connectivity, thus the whole āBlynk for IoTā shtick.
BT/BLE was primarily intended for PAN (personal area networking) AKA a wireless link between close devices, generally connected in a āas neededā basis.
While simply switching to a longer range WiFi solution ( high gain and/or directional antennas) for your Solar MCU might be the easier way, you could possibly run your Solar MCU without Blynk, and have some form of BT link on the phone that will upload the recorded data, as desired, to Blynkās server (Webhook?) as needed for viewing/processing in another Blinkified MCU and the App.
Thanks everyone for your feedback and suggestions, clearly I did not fully understand how Blynk works.
How remote is remote? Kilometers / miles?
It is a boat marina about 65 miles from me. I do not mind driving down there periodically but the boat is covered in the winter where the Arduino is taking measurements on boats main battery voltage etc. today I have to open the cover, go inside remove the SD card to review the readings on a laptop. I totally misunderstood how blynk works, I thought if I got close enough within range of Bluetooth I could somehow have my iPhone connect and pull down the data. I also looked at a cellular option but really do not have the need or expense to have the data streamed in real time.
As youāre (presumably) putting your Arduino to sleep for long periods, then waking it up to take and save battery voltage readings, the idea of adding a Blynk Bluetooth connection wouldnāt really work either.
The device would only āseeā the Blynk Bluetooth connection request when it was awake, and Iām guessing that you donāt wake it up more than a couple of times per day.
If thereās no Wi-Fi available in the harbour then the only viable alternative is a GPRS modem and SIM card. Youād need to power the GPRS hardware down between transmissions to avoid battery drain, and it probably isnāt worth the effort.
Pete.
Why not use your iPhone as a wi-fi hotspot? Once your iPhone is within range, your device should automatically connect to the wi-fi hotspot and to Blynk. I just tested it. It seems to work fine.
The Arduino would need to have an ESP-01 added to give Wi-Fi connectivity (probably MUCH better if it was replaced with a NodeMCU or Wemos D1 Mini), but if the OP is is putting the MCU to sleep between readings then heād have to wait until it wakes-up before it can see his iPhone.
Heād also need to make sure that he doesnāt use the blocking Blynk.begin command so that code will execute as it does now if thereās no hotspot available.
Pete.
I donāt imagine @JimK would mind spending $2.50 USD for a new device.
Heāll need to evaluate whether he still needs an SD card. If so, we can discuss the ābestā wi-fi + SD card solution.
Heāll need to evaluate whether the device needs to be put to sleep. Is he putting his Arduino device to sleep today? Is current draw a concern with a solar panel?
We can help him with non-blocking code.
His biggest challenge was wi-fi connectivity. That problem is solved.
Presumably, as he feels the need to monitor the battery voltage.
Heāll need to store the data somewhere, as it wonāt be being uploaded to the Blynk server. He could use ESPROM or SPIFFS on a NodeMCU. Read/Write life would be a consideration, but shouldnāt be a problem.
Owning a boat can be expensive, maybe he doesnāt have that sort of money to splash (see when I did there) about
Pete.
Hi guys,
Appreciate all the ideas. There is plenty of power on the boat even though it is in winter storage. I have a 100 watt solar panel keeping the main house battery, a 4d deep cycle with around 1200 amps capacity so I leave the arduino on all the time.
I like the idea of creating a hotspot. As I said I have little hardware experience but do have a couple WiFi shields and an arduino WiFi rev 2 board around, although when I googled it looks like I would need a esp8266 to create a hotspot. I have tested simple demo sketches using an arduino WiFi shield accessing it from my local network to toggle a led but I do not think that is the same as a hotspot.
I did find this tutorial about using Bluetooth and an iPhone, but still trying to read and understand if it might work. I have never done anything with Bluetooth and the concept kind of intrigued me.
Thanks
It would be exactly the same as a hotspot. Iām suggesting you turn your iPhone Personal Hotspot on. Your iPhone is the hotspot.
char ssid[] = "your iPhone wi-fi SSID";
char password[] = "your iPhone wi-fi password";
I did not know you could do that, thanks !