Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

using HTTPPost to send out data from a datatable


JPRodrigues Feb 14, 2018 01:08 PM

Hi

I have need to send data from some dataloggers to a server through HTTP and im using HTTPPost to do it

at this moment im reading the datatable, field by field and mounting the message i want.

But i was reading the help from the function and it says that i can use data directly from a data table.

My problem is that i cant find a way to read the datatable directly (i was trying to avoid creating a new file in memory!!!)


Can anyone help me with this?

Best regards


aps Feb 14, 2018 02:55 PM

Please have a look at this document which discusses ftp streaming:

https://s.campbellsci.com/documents/us/technical-papers/ftp-streaming.pdf

The same principles apply to httpost, using similar optional parameters at the end of the instruction.

Make sure that you have the latest operating systems and help system in the CRBasic editor so you have full details of the extended parameters.


Evaldebenito Jul 18, 2018 09:08 PM

Hi, how are you doing?

JPRodrigues, do you have any examples using HTTPPost?
It would be a great help to us.
thank you very much from now on to anyone who can help us

Greetings,
EValdebenito.


JPRodrigues Jul 19, 2018 09:45 AM

Hi Evaldebenito

In my case, as i didnt get what i was expecting, i twisteted the question a little and to my URL I added the tokken with the identification of the station and the collected data:

token_ini= "?token=lpEFICUcXZbYlDW18H6Kd9tYPP8DCycW&timestamp="+tabletime+"&record="+Dados10m.record(1,1)
token_temp= "&temp="+Temp+"&temp_avg="+Dados10m.temp_avg(1,1)+"&temp_max="+Dados10m.temp_max(1,1)+"&temp_min="+Dados10m.temp_min(1,1)+"&temp_std="+Dados10m.temp_std(1,1)
token_hrel= "&hrel="+HRel+"&hrel_avg="+Dados10m.hrel_avg(1,1)+"&hrel_max="+Dados10m.hrel_max(1,1)+"&hrel_min="+Dados10m.hrel_min(1,1)+"&hrel_std="+Dados10m.hrel_std(1,1)
token_vento= "&vvento_wvc1="+Dados10m.vvento_wvc(1,1)+"&vvento_wvc2="+Dados10m.vvento_wvc(1,2)+"&vvento_avg="+Dados10m.vvento_avg(1,1)+"&vvento_std="+Dados10m.vvento_std(1,1)+"&vvento_max="+Dados10m.vvento_max(1,1)+"&dvento_smm="+Dados10m.dvento_smm(1,1)
token_prec= "&precip_tot="+Dados10m.precip_tot(1,1)+"&intprec_max="+Dados10m.intprec_max(1,1)
token_porv= "&porv="+POrv+"&porv_avg="+Dados10m.porv_avg(1,1)+"&porv_max="+Dados10m.porv_max(1,1)+"&porv_min="+Dados10m.porv_min(1,1)
token_batt= "&batt_min="+Dados10m.batt_min(1,1)

token=token_ini+token_temp+token_hrel+token_vento+token_prec+token_porv+token_batt

HTTPPost ("http://api.sug.prilaier.org/probes/meteorologicas_teste.php"&token,"",HTTPResponse,"")

In my case this does the trick. Hope it helps you.

Any question you have that i can help please ask.

Best regards

JPRodrigues


mortenx Jul 28, 2018 10:15 AM

how can i make "if" statement so that httpost done so many times when its ok ?
sometimes it is getting error "Http comms Error"


Nicolas Jul 2, 2021 02:40 PM

Have you found a solution to directly read the content of a table?

Thank you


patdavid Mar 23, 2022 09:25 PM

This post is under review.

Log in or register to post/reply in the forum.