What you see
A refused request reaches your sketch like an answer from the server: the
status code (429 for a limit, 0 for anything else) and the message as the
body, so Serial.println(http.getString()) prints the reason. Messages about
turning it on show beside the Real internet switch. How Real internet works is
in Real internet.
Turning it on
- "Sign in free to reach the real internet." Signed out, the board keeps
the simulated network (
time.mokxi,weather.mokxi,echo.mokxiandapi.mokxi). Any free account can turn real internet on. - "Confirm your email address to use real internet." Open the link in the email we sent you, then try the switch again.
- "Real internet is off for your class. Your teacher can turn it on in the class settings." For class students, and for younger children, it stays off until a teacher with the class tools turns it on.
- "Real internet could not be checked just now." The board stays on the simulated network. Try the switch again in a minute.
The limits
- "Real internet on Free sends at most 10 requests a minute per account and
10 per project" (Pro: 30 and 20). Put a
delay()in yourloop(): one request every few seconds is plenty for a weather reading. - "Real internet on Free sends 100 requests a day per account and 50 per project. It starts again at midnight UTC." On Pro the message reads "Real internet sends at most 1000 requests a day per account and 500 per project". Wait for midnight UTC. The full table is in Real internet.
- "Your network has used its real internet requests on Free for today." Free accounts on one network share 300 requests a day, so a classroom on Free can run out together. It starts again at midnight UTC.
- "A request body may be at most 1024 bytes" and "the body was longer than 2048 bytes and was cut" on Free (Pro: 2048 and 4096). A board's request and answer are kept small. Ask the service for less, for example with fewer fields in the URL.
- "The host did not answer within 4 seconds" or "the host could not be reached". The service is slow or down. Try again later.
Refused requests
- "Only GET and POST go through the gateway."
- "Blocked: ..." The address is one the gateway does not call: a private or local address ("that name points at a private address"), a name with no dot, a port other than 80, 443, 8080 or 8443, a user name or password in the URL, an address that is not http:// or https://, or a name that does not resolve. Use a public web address.
- "The gateway does not follow redirects." Use the address the answer
points to, often the same one with
https://. - "The body was ... which a board cannot print, so it was left out." The answer was an image or other binary file. Ask for JSON or text.
- "That URL is empty or too long." URLs are at most 2048 characters.
MQTT
- "The gateway publishes to test.mosquitto.org, broker.hivemq.com, broker.emqx.io only."
- "A topic is 1 to 128 bytes with no + or #" and "an MQTT message may be at most N bytes": 512 on Free, 1024 on Pro.
- "Publish with POST to http://mqtt.mokxi/publish?topic=..."
Still stuck
Write to us from /support with the exact words you saw.