REST api values not shown in iOS app

Hello,

is there a different data store for the REST api and the iOS app?

I have created a dashboard on the iOS Blynk app with a labeled value for V1 and tapped on the ›> button.

I tried to write a value with
curl --include --request PUT --header "Content-Type: application/json" --data-binary "[\"20\"]" 'http://cloud.blynk.cc:8080/[APIKEY]/pin/V1'

The writing seems to work. I can access the value via
http://cloud.blynk.cc:8080/[APIKEY]/pin/V1

The expected result on the iOS app would be, that the value is displayed, but instead the label field is empty and ‘Generic board is offline’ is displayed.

How can I fix this?

Or other way round, how do you send Blynk.begin() via the REST interface?

Thanks and best regards,

Hello.

no.

Correct.

Could you please change value via HTTP when project is running? Does it display value in that case? Does same scenario works for value display?

@user100 also there is a chance you didn’t type anything in format field. It should have at least /pin/ string

Hello Dmitriy,

thanks for your questions.

I don’t know. I don’t have the library running on a device, I only used the REST-interface. I haven’t found a command to send Blynk.begin() via the REST interface. My usecase is, that I have an Arduino Micro Pro which sends data over an nRF24-connection (so I can’t use the blynk library) to a RaspberryPi which sends the data to Blynk. I use the nRF24-connection to save battery life.

You mean in the iOS app? I’ve selected the PIN, the range for the value field. I don’t know that the sign in between the range display means, and I haven’t entered anything in the value display field of the iOS app.

As written in the first post, I think a command to send Blynk.begin) and in addition a command to send the ping via the REST interface is needed.

As far as I understand, the iOS app only checks for the current value of the register (like V1, V2), when the corresponding device is generally online (via Blynk.begin()) and at the moment, when a ping/keep-alive/heartbeat is received from the corresponding device.

For me this is a bit strange, as the device is actually polling the backend (even when the corresponding device is offline, but not displaying the value. If this is intentional, I understand that the REST interface is only intended for getting information FROM the device, but not sending TO the device.
=> The topic can be closed as I won’t use the REST interface for this use case anymore.

Thanks a lot for your project anyhow.

Best regards,

You have to put /pin/ string (just click on it) in widget field (this field is above “Frequency Reading” field).

No, it is not needed.

This is true for “Frequency Reading” mode. But not true for PUSH mode. With PUSH mode you can change widget state via HTTP API.

It is also can be used to send values to device. If device is online value will be send right away. If device is offline you have to use SYNC feature in order to get latest value from server.

Ok, I retried and got different results.

  1. I made a new board in the iOS app and added a value display.
  2. Send new value
    curl --include --request PUT --header "Content-Type: application/json" --data-binary "[\"15\"]" 'http://cloud.blynk.cc:8080/.../pin/V1'
  3. Value was displayed (no matter which sync timing (push/1sec) and no matter how I labeled the pin-channel (didn’t had to use /pin/ as the name).

Perhaps the backend yesterday had a problem? It even worked with the graph or the history channel (not so reliable on the history graph). Cool. Made an in-app-purchase.

By the way, it would be great if the elements (displays, graphs) could be resized (bigger fonts, larger height) on the iOS app. Another thing is, that I’d like to have multiple elements that show the same information (like value display which shows last value and in addition the history graph on the same page).

Thanks for the support.

I think the initial problem was in widget you choose for experiment. Labeled display is not same as value display. And Labeled display requires /pin/ string while value display doesn’t.

Yes, This is feature :slight_smile:. In Frequency Reading mode widget still also works as PUSH widget.

You mean few value displays for instance for same pin?