ESP32 webserver - reading data from text field - esp32

I am absolutely new to this and need some help. I am working on a door lock that can connect to the network and work with the database to sort access and whatnot.
And I am creating an access point mode in which the user can go to the page provided by the ESP32 and set SSID and password of his own network that the ESP32 will then remember - I can create the web, I can create a text field, and submit button but I have no idea how to read that data the user inputted and save it in my variables.
Can you refer me to some website where I can read more about it?

Do you want to go the Arduino/PlatformIO or ESP-IDF route? (For student/hobby Arduino is good, but for professional products I recommend ESP-IDF.)
https://github.com/chmorgan/esphttpd-freertos is a decent working example of WiFi provisioning via ESP-hosted webserver.
It is also a good starting platform to build your app from (it's what I use).

Related

Script to run at first logon in OS X to "call home"?

I sell Macs and i'm looking for a way for our security and to combat purchase fraud to have the machines phone home the first time they are booted up to show that machine has been in use at the clients IP address.
Now I know the client might set the computer up at a location other than their home and could spoof their IP (although the potential scammer wouldn't realise this system was in place so wouldn't be expecting to do this) but any system is better than no system.
In terms of privacy we'd put it in our privacy policy but of course we're not looking to collect any information from the user apart from their IP address and the script should delete once its connected to the internet for the first time.
How would users recommend the best way to do it? I have full access to the computers before hand and we already launch a script on first boot of user account to show a welcome and help guide - so we could add simple scripting there, but maybe a helper program which attempts until internet connection is first established, makes contact and deletes itself is best.
And of course we'd need a two pronged approach, a URL or API of some sort on our server that the computer connects to. Ideally the information to send would be the serial number and the IP address of the user, the MAC address could be useful too - as often if fraud has been committed the police will also check to see if the original MAC address of the system has connected via the ISP server logs.
I suppose the final piece of the puzzle would be that our logged data would somehow need to prove it was sent from that computer and not just generated ourselves in a database (eg we haven't just pretended its connected from their IP we've picked up from an e-mail address or something) i'm not sure if there would be any secure legal way to do this?
=============
Edit: Thinking of ways to make it legally binding in terms of presenting the information to the police or the courts I think the receiving server would need to be hosted and maintained by an independent third party whom you had a contract with and didn't allow you any write access to the information what so ever, all you could do is visit a website and pull up the data to pretend the evidence to the police.
(I seem to have been voted down because someone likes committing fraud?)
I have looked into similar solutions for macbooks in the past with little luck. One thing I have found however, if you have a web server, is to create a php page in an obscure hidden directory that will capture the ip address and send an email on access. From here you can create a page specific to each computer with MAC and serial number and set this as safari's homepage in a different tab. So every time someone attempts to access the internet you will be notified.
(This php page can be a simple blank page that just looks like a new tab, or can even display warnings such as "You are being tracked")
You could also create a python script on startup to send the information you are looking for such as ip, mac and serial number back, but again you would need another server setup as a listener.
And lastly, if possible, create a business account in icloud and use Find My Iphone/mac. This is probably the easiest if you can get away with it but unfortunately will not provide you with instant notifications.
-M

VB.NET Mobile Application Settings

I've created an application that stores username and password information, inserted by the user, using the Application Settings. This application is suppose to be mobile, I mean, you should be able to carry it from one computer to other without losing information. But I've notice that when I change the folder the app is in, all settings are lost. I've run the internet in search for answers, but all I've found is storing the data in XML files.

iOS hosted web page (user data backup/restore)

I'm interested in implementing a 'user data' backup facility for the core data sqlite database within my application.
In applications like 'simple pdf reader' you flick a switch in the app and are provided with an IP Address and port number. You then enter these details into a computer browser on the same wireless network and can then get to a web page hosted by the device. This real world example allows copy of pdf files to and from that device's app. I'd like to use the same idea to allow back up and restore of the core data database file in future versions of my app (iHeals)
I've no problem creating web pages, I'm just unsure on how to get my app to host one. Any direction is most appreciated.
Cheers,
Tim
You should take a look at implementing this framework or this one.

What's the best way to save the sensor data to local machine for analysis?

HI,
I am building a small application using accelerometers on the phone. I hope I can get the accelerometer data from the phone and analyze them at my PC and then I can build a model based on these data and deploy the model on the phone.
But I just don't know how to get the data out of the phone.
Thanks a lot!
For testing you could write to Debug when running from within Visual Studio.
Beyond that you'll need to send the data to a web service running on the local PC.
As a third alternative, you could save the data to IsolatedStorage on the device and then use http://wp7explorer.codeplex.com/ to get this files off the device.
If you log the data on the phone, you can later (say when you touch a button) send the data to a web service stored on your computer.
If you log the data in a string then your web service should expose a method that accepts a string input. It should be easy to setup and it is really easy to use from the phone, just use the Add Service Reference wizard to connect to it.

Transfer files between users of the same app with "cloud" storage

I am building an WPF app that need to exchange some very small xml files with other users. I'm currently looking into peer2peer networking, but I need the sender of the files to be able to send without the receiver being online also. I do not want to host a service myself, and I want the users to store the other users they interact with locally on their machine, for example just a name together with a GUID or email adress to identify them.
Do you guys have any suggestions on how to solve this? My wishful thinking would be if there was a free or cheap service where users could connect via my program to a public API and upload their files. And when the receiver user logs on, it would check the service and authenticate somehow, and download the XML files so it could be imported by the program.
I have made a solution with a IMAP library where the XML files are attached in the email and sent to the receivers email account. The program on the receiver checks the email and read the attachment. This works ok, but is not very slick and also filling up the users inbox and sent items with garbage..
Any suggestions is greatly appreciated.
Best regards
Ola
This is one idea:
Normally, Block Storage volumes are seen as extra 'Drives' that you attach to a Virtual Machine. You could then use this but as if it was a metaphorical 'USB flashkey' that you would share with the other person.
Create the storage volume
Attach it to your VM and copy your
data-to-be-shared on it
Detach the volume from your VM
Your Buddy, attaches it to his VM
He then copies the files and voila!
All this could be done through a web interface and you wouldn't have to do any networking steps.
All you need now is a capable Cloud Geek, a pot of coffee and some convincing.

Resources