collapse

Welcome!



Welcome to Robot Rebels, an online robot maker community.

Register today to post your projects, ask questions, share knowledge and meet like-minded people from around the world.


The RobotRebel.org Community

Recent Posts

Pages: [1] 2 3 ... 10
1
Software / Web TIme API -
« Last post by Gareth on December 07, 2018, 04:34:37 PM »
My latest ESP32/Nextion touch screen Weather/bus/train times project required a realtime clock.... however it has taken me quite a few weeks to find a good solid solution.
Firstly :-
....if you want to stay sane then avoid epoch time (best thing that happened in 1970's was "punk Rock" not unix count my seconds birth)....rant over.

If your ESP(range of MCU's) requires a neat way to sync things to a clock then here is the easiest way I have found (tnx KA for the shoutbox Ping>>>).

Many if not all API web calls have a handshake header message before the real data is exchanged.
I am extracting weather data from the openweathermap.com project.
Its relatively easy to get the weather_data however it a bit more tricky to obtain some coherent date and time from it.

Code below is for an ESP32 :-

#include <WiFi.h>
#include <HTTPClient.h>
const char* ssid = "Gareth";         //Router name
const char* password =  "Slatybartfast";  //Router Password
const String PollTimeAPI = "http://api.openweathermap.org/data/2.5/weather?lat=-77.66&lon=168.22&units=metric&APPID="; // simple web call to extract weatherdata , however can double up to extract header data as well
const char * headerKeys[] = {"date"};//The data key you require from the HTTP Header
const size_t numberOfHeaders = 1;    //The number of keys in your array above
int pollApiTime;
void setup() {
 Serial.begin(115200);
 WiFi.begin(ssid, password);
 while (WiFi.status() != WL_CONNECTED) {  delay(200); Serial.print(">"); }
 Serial.print("Connected to "); Serial.println(ssid);
 }
void loop() {
  if (millis()-pollApiTime >=10000) {PrintDateTime(); pollApiTime=millis(); }
}
void PrintDateTime()
{
 if ((WiFi.status() == WL_CONNECTED)) {              //Check the current connection status
   HTTPClient http;
   http.begin(PollTimeAPI);                          //Specify the URL
   http.collectHeaders(headerKeys, numberOfHeaders); // here is how to access certain data fields in the HTTP responce header
   int httpCode = http.GET();                        //Make the request
   if (httpCode > 0) {                               //Check for the returning status code  :-)
   String headerDate = http.header("date");          //extract the date and time field
   Serial.println(headerDate);
   http.end();       }                               //free up the request
                                      }
}


Resulting output :-

I am polling the data every 10 seconds here for demo, though in reality I would only need to sync the time maybe once/day.
As far as I can gather the HTTP specifications for the Date & GMT Time layout is quite strict, which makes it easy to split the data up.
2
Code Snippets / API Directory
« Last post by Gareth on December 06, 2018, 03:34:16 PM »
Looking for a Web API site to extract some data from ....
Here is a great resource :
API Directory :- https://www.programmableweb.com/category/all/apis?keyword=time
3
3D Printers / Re: The Original Prusa I3 Mk3
« Last post by tinhead on November 30, 2018, 02:49:52 PM »
Well belt has teeth rubbing on the flat pulleys, if nothing else at least the belt sits better. I had them already so why not try?

Oh yeah and there is the diameter which is about one... Or so smaller on the teeth iders so belt is going straighter horizontally... Neat.
4
3D Printers / Re: The Original Prusa I3 Mk3
« Last post by Bajdi on November 30, 2018, 02:26:48 PM »
I've never used toothed pulleys on the idlers. Don't think they are necessary?
5
3D Printers / Re: The Original Prusa I3 Mk3
« Last post by tinhead on November 30, 2018, 04:38:53 AM »
Updated, bump!
6
Suggestions and Vision / Re: Email notifications
« Last post by CraigCox on November 28, 2018, 10:26:06 PM »
Ich möchte über das Wissen auf dieser Website Bescheid wissen, unabhängig davon, ob die Daten tatsächlich ausgetauscht werden oder nicht, weil ich die Informationen ändern möchte.
7
Introductions / Re: And another one.
« Last post by CraigCox on November 28, 2018, 10:17:54 PM »
Das Wichtigste, was ich verstehe, ist, dass diese Website eine sehr kenntnisreiche Website ist, in der sehr viel Informationen ausgetauscht werden kann.
8
3D Printing / Re: MKS Gen L 1.0
« Last post by jinx on November 28, 2018, 02:23:50 AM »
Quote
How many amps can I draw from the FAN port? (24V)
You say the MOSFET is rated 4.5A, does this get reduced because it needs to generate a PWM signal?
am not the best person to ask this one, SO take what I say with a pinch of salt!.
 the fets are rated for 4.5A doesnt mean you need to draw that much with a 24v,  as I recall a 24V setup requires less Amps, now PWM works by varying the voltage slightly (you can see this with a multi meter) not the current...
  someone once said current (Amps) bit like a water tap opening and closing when you require it.
9
3D Printing / Re: MKS Gen L 1.0
« Last post by Prokktor on November 27, 2018, 08:35:38 AM »
Hi,

I have a MKS GEN L 1.0 and want to upgrade some stuff.

How many amps can I draw from the FAN port? (24V)
You say the MOSFET is rated 4.5A, does this get reduced because it needs to generate a PWM signal?

Thanks for your time

regards

Martin
10
3D Printers / Re: The Original Prusa I3 Mk3
« Last post by tinhead on November 26, 2018, 02:42:26 PM »
That would be another 300 Euros hmm maybe the Easter Bunny can help... ;)
Pages: [1] 2 3 ... 10

* Search


* Recent Topics

Web TIme API - by Gareth
[December 07, 2018, 04:34:37 PM]


API Directory by Gareth
[December 06, 2018, 03:34:16 PM]


The Original Prusa I3 Mk3 by tinhead
[November 30, 2018, 02:49:52 PM]


Email notifications by CraigCox
[November 28, 2018, 10:26:06 PM]


And another one. by CraigCox
[November 28, 2018, 10:17:54 PM]


MKS Gen L 1.0 by jinx
[November 28, 2018, 02:23:50 AM]


This kids a freaking genius by ossipee
[November 21, 2018, 04:55:40 PM]


Time of Flight >>> Rounded Corners !!! by Gareth
[November 15, 2018, 03:21:51 PM]


Double_ing up the "Time of Flight" sensors by Gareth
[November 13, 2018, 04:05:02 AM]


Point cloud anyone !!! maybe 3D scanner by maelh
[November 11, 2018, 05:38:33 AM]


removable magnetic print surface by Gareth
[November 09, 2018, 10:53:45 AM]


Robot Cop by Valeriex
[November 07, 2018, 05:48:20 AM]


it's lukeyes by Valeriex
[November 07, 2018, 05:47:16 AM]


TOF gets a local DEBUG screen by Gareth
[November 07, 2018, 03:47:29 AM]


BlueTooth elves choose "BlueTeeth" by Gareth
[November 07, 2018, 03:40:19 AM]

* Recent Posts

Web TIme API - by Gareth
[December 07, 2018, 04:34:37 PM]


API Directory by Gareth
[December 06, 2018, 03:34:16 PM]


Re: The Original Prusa I3 Mk3 by tinhead
[November 30, 2018, 02:49:52 PM]


Re: The Original Prusa I3 Mk3 by Bajdi
[November 30, 2018, 02:26:48 PM]


Re: The Original Prusa I3 Mk3 by tinhead
[November 30, 2018, 04:38:53 AM]


Re: Email notifications by CraigCox
[November 28, 2018, 10:26:06 PM]


Re: And another one. by CraigCox
[November 28, 2018, 10:17:54 PM]


Re: MKS Gen L 1.0 by jinx
[November 28, 2018, 02:23:50 AM]


Re: MKS Gen L 1.0 by Prokktor
[November 27, 2018, 08:35:38 AM]


Re: The Original Prusa I3 Mk3 by tinhead
[November 26, 2018, 02:42:26 PM]


Re: The Original Prusa I3 Mk3 by jinx
[November 26, 2018, 02:24:05 PM]


Re: The Original Prusa I3 Mk3 by Bajdi
[November 25, 2018, 07:54:21 AM]


Re: The Original Prusa I3 Mk3 by tinhead
[November 25, 2018, 06:11:22 AM]


Re: The Original Prusa I3 Mk3 by Bajdi
[November 25, 2018, 04:40:31 AM]


The Original Prusa I3 Mk3 by tinhead
[November 24, 2018, 12:02:51 PM]