Need to make remote datalogger on my hosting

Dear all,
I need to build datalogger, ESP8266 to php to MySQL,
I can’t,
Any help please
Best regards

It’s not working due to this:

If you have a custom domain, you can follow this guide:

5 Likes

Many thanks for your supports,
But still I have same problem, and can’t solve the problem.
to test with common example/problem I test project at this website :
ESP32, Data Visualization, and Data Logging | by Tara Chandani Haryono | Medium

or any other example, i.e. ESP32 on H/W side, need to call PHP on server side (PHP connect to MySQL to store and retrieve data) by the way the PHP work will when I calling it in bar of any browser while not work if it embedded from ESP32.
Any help please.
Best regards

Did you setup Cloudflare on the domain? What error message are you getting? Is anything logged in the CF WAF event log?

2 Likes

That’s because the problem isn’t supposed to be solvable. Our hosting is intended to be used to host a website, and what you’re doing is not normal website behavior.

Please consider using a different host for this project.

3 Likes

I (after some reading) added some rows to the start of PHP file as following :

    header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
header("Access-Control-Allow-Headers: Content-Type");
echo json_encode(["status" => "success", "message" => "Hello ESP32"]);

That seam that server didn’t run any php called from ESP32 or other Arduino H/W.

Still the problem not solved, any help please.

How? please

By following the guide that was sent to you earlier. If that doesn’t work for any reason, you’ll have to upgrade to premium in order to do what you want. Premium hosting doesn’t have the security system that prevents non-browser connections, and it also allows remote database connections.
Edit: Sorry, I was super drowsy when I wrote the original post

3 Likes

this is the response from server to ESP32 :

This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support

after any calling to any php on server.

How ? please

By following the guide Frank shared with you in the second post of this topic.

3 Likes

Dear Mr. Frank
Many thanks for you,
Many thanks for all.

the project already worked in past with paid hosting, but now I can’t pay for them, and even can’t pay for nay hosting now, in same time I need to make show/test the system working for proposed customer.
I just now need to run system for some days, hope to consider.
what is the way to re-run the system with this new free hosting ?
I need to call PHPs from ESP32,
I asked ChatGPT to solve with me and even got a lot of codes but fail.
what is the solution now, please ?
can Mr. reduce the security level in my hosting to pass through the project please.
or what you suggest ?
The PHPs run well if calling them from bar-browser
best regards

I received like this response when calling PHP from ESP32 :

This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support

any help please

By following the directions you were already given. What’s your site’s URL anyways? Are you using a custom domain, or do you have a free subdomain from InfinityFree?

You shouldn’t blindly follow programming or website management advice from ChatGPT anyways, but it’s especially not going to know much if anything about a security system used exclusively for the free hosting infrastructure for a specific company.

You’ve already been given the solution. It’s up to you to follow it if possible.

Nope. Every hosting account with InfinityFree is identical in terms of features, limits, and functionality. Exceptions aren’t made for anyone, and the system doesn’t even have an option for them anyway.

Well, yes. Ensuring that requests come from web browsers is the point of the security system.

3 Likes

like what in here :

Yes, as that article explains that is working as intended. Please follow the instructions from the guide.

InfinityFree isn’t a managed service. We can’t help you if you aren’t willing to read the directions and help yourself.
If you can’t use Cloudflare (because you don’t have a custom domain) then you can’t do what you’re trying to do unless you upgrade to premium, or use a different hosting service that meets your needs better. It is as simple as that.

5 Likes

Thanks for your help.
I don’t need more than running PHP like what do with browser.
i.e. run this command at ESP32 or ESP8266, this command :

           Link = "https://b-expert.wuaze.com/octameter/sql_insert.php?id=3333&temp=280&humi=215";
           http.begin(Link.c_str());

it return value greater than zero

while the same php run in browser-bar

best regards

InfinityFree isn’t meant for remote PHP code execution, and using cron jobs (including using third party tools for it) isn’t allowed.

You said that visiting the link in your web browser allows the code to run. You’ll have to just do that manually when it’s necessary.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.