Re: HTML and PIC communication

First you need TCPIP communication.
You can go with ethernet phy on pic eg PIC18F87j60. Any pic with external phy eg ENC28j60, and implement TCPIP on pic.
Or go with w5500 with integrated TCPIP. Or go fuli integrated like some of microchip RN wifi modules, esp8266, or go with GSM/EDGE solution, with full TCPIP https etc...
When you sort that, then it's easy. Like little more complicated serial port.
Simplest would be using some modem with fully integrated IP application.
I could give you more specific answer, but I need more details.

Re: HTML and PIC communication

It obviously isn’t PBP, but Microchip has an evaluation board and sample code that does exactly what you describe.
It was later expanded by hobbyists to include Chan’s SD card library to host a web page, which is where I started on it,
and made some demos, one of which could control a garage door with a smart phone, or other internet connected device.
Not something I’d trust to use practically, but it worked.

The code was a bit flaky, and didn’t work at all with some routers I’ve owned over the years, which is why I didn’t do much with it.

Re: HTML and PIC communication

in this day and age it would seem a retrograde step to need a wired interface . those nodemcu esp8266 things are so cheap , heaps of pins to i/f to pic.
i have been using raspberrypi's as a go between. next project i will look again at the esp offerings. i had a go with the esp-01 but found them unreliable and subject to lockups , surely they have improved

Re: HTML and PIC communication

Agreed Ricahrd.

But right now the physical layer is not my main concern. There are many options either wired or wireless (though I prefer wire for many reasons and all my devices are static IP, wired connected except my phone which has sometimes problems(!)).

I have to succeed first communication of the PIC with the html page and the rest will follow.

For example what is the html syntax to update a specific field in a specific page (if there are more than one)? Such things

Re: HTML and PIC communication

you should be able to store/retrieve/edit data in an xml file with html ,i'm not sure how though its the blind leading the blind ,i'm watching with great interest
afaik html has no native access to any physical comms layers , i/o is a client server type arrangement using put/get post etc.
access to a tcpip socket needs java or similar

Re: HTML and PIC communication

i guessing you don't have the source code . do you know what code language/s were used.
python does that sort of thing fairly easily , it can do serial/ tcp sockets or just about anything else
sql included

Re: HTML and PIC communication

I think what you may be looking for is HTML forms.

<FORM></FORM> tags define the boundaries and allow the definition of a method of transferring element content as a delimited list from inside an HTML document. The [Apply Changes] button (in your example above) is a [SUBMIT] button with a custom caption. To write values (default or otherwise) the "VALUE" property of the control is given a value. Here is an example (you may cut and paste this into Notepad, name with an .HTML extension, and open in a web browser:

Code:

<!DOCTYPE html>
<html>
<body>
<h2>HTML Forms</h2>
<form action="/action_page.php">
First name:<br>
<input type="text" name="firstname" value="Mickey"> 'The value "Mickey" will appear as default text when the control is loaded. the "sent" value would be firstname&Mickey;[next name&value pair]; etc.
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br><br>
<input type="submit" value="Apply Changes">
</form>
<p>If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".</p>
</body>
</html>
This is from https://www.w3schools.com/html/html_forms.asp - a competent tutorial, free and concise. It even allows you to test your code in a WYSIWYG environment. Quite nice.

Other types of controls can return numerical values, true or false values, coordinates from image maps...
Of course, this example is for the internet and a remote server, on a MCU, you might generate and evaluate your "page" in subroutines, transferring the created file/s back and fourth to a browser by wifi, serial link, or other other means.

Re: HTML and PIC communication

Yes, I'm sorry that it is not so easy, from there.

I think it may be necessary to visit forums for programming - depending on your operating system. The crux of your issue is the "bridge" program - it seems that it will be necessary to catch incoming serial data, then send it to an internal router address and port. It's quite easy to point your browser at an internal port, but how to route the serial... beyond me.

Years ago I was a VB programmer and we had specific tools for capturing Com Port I/O and, likely there were/are similar internet gateway tools now. Unfortunately they aren't included in PB3.0. ;-)

Re: HTML and PIC communication

That, my friend, is awesome!

I have an aquarium controller project (2.0) that is paused for just such an interface - my interest was not altogether altruistic. Please elaborate on "Involt" is this a third party from somewhere, a hobby web site... Link? How do you address your browser?

Re: HTML and PIC communication

First, I didn't read all post. But from what i did, you got on wrong way... You have whole PC in middle. If you want that write simple server in vb .net(there is a lot examples) and use USB example from forum.
This shouldn't take much of time, maybe week or two if you don't have any knowledge in VB .net.

If you want GPRS modem start with that. As it will be shortest and easiest way to get to final goal. I were few years ago in same place as you were. And it was overwhelming. But since then I menage to get PIC with eth phy on it working to serve page, get FTP client on pic with modem, use HTTP POST/GET, etc...

If your goal is GPRS control and monitoring then you need:
1. Server to host page that user can access, log in, view and set parameters
2. You need GSM/GPRS modem that has IP application on it, or at least TCPIP.
Your workflow should be:
1. Find server
2. Get it working, eg host simple .txt file on it
3. Chose protocol over which you get that file to PIC. Eg HTTP GET or FTP(you have user/pass). You have GPRS modem with FTP client/server on it. I used TCPIP stack, and implement FTP client in PBP.
4. Send file on server(quickest way is HTTP POST), easiest is FTP as it doesn't request nothing custom on server side.
5. Get file from server, parse it and do what ever.
6. Make front end html page that will show your values from files, and save values.
Other much more complicated way is to get fixed IP on your modem, run server on modem, host everything on PIC. Biggest problem is getting public fixed IP on GPRS.

Re: HTML and PIC communication

Although I got up to that point that I post, I had that feeling it was not in the right direction.

But, after your post, seems higher then Everest...!

Fixed IP on GPRS is not available at least in my country, so a dedicated server is needed in every case. This is a problem to solve. What the server will be, what software etc.

The main thing that I want is to have a PIC board connected to a PC and configure it through a web browser, using text boxes, radio buttons or check boxes. Maybe sliders too for analog values. This should work either way (meaning PIC show values on screen).

If that works, then this connection alternatively could then be a GPRS modem to configure from far away.

Re: HTML and PIC communication

That is almost two totally separate things.
One is configuration over PC, other is over web.
Because it uses two totally different physical layer and probably different protocols.
If you use GPRS modem, then all lower protocols are taken away from you, which is really good thing.
Same is if you use PBP USB stack.
So separate that into two independent things.

For PC<>Pic simplest is serial over usb, then HID usb.
You can use external USB<>Serial, or implement CDC in PIC. But you need PID and VID, you can get it for free from microchip. But if you want your VID it may cost up to 5000$/year. I use simple USB<>ttl serial FTDI cable.
You need application for that on PC. This application can be what ever you like, but it need installation. It can be server on local host, so you can do things from browser.
As most user arent familiar with networking(firewalls, ports etc), it is much easier to make stand alone .exe, so they can just double click on it, and run it.
Look on app can be exactly same as on web page.

Other thing is modem. I suggest to get some dev board for desired modem, connect to serial port, and start typing commands in some terminal program.
Here is example of accessing FTP from simcom modemhttp://dostmuhammad.com/blog/ftp-file-download-sim900/
Also you probably want to use flow control on modem, so you can pause receiving file while you process received part.
If you decide to try server for freehttps://www.000webhost.com/
Only downside is you can't access it 2 every 24.

PS
Public fixed IP on GPRS aren't available anywhere in world as far as I know.

EDIT:
To test post/get etc I use https://httpbin.org/#/HTTP_Methods/patch_patch
And when you already have server, don't be afraid of PHP, JavaScript, Ajax etc... As they can change just part of page, without reloading whole page. And that refresh tag someone posted, can be rely annoying, because you start typing into txt box, and it refresh, so you type faster, but then try to set value, and another refresh... Isn't rely useful for input.

Re: HTML and PIC communication

Re: HTML and PIC communication

So it appears that the MCU [Arduino] maintains an array, sending and receiving elements serially. It looks as though the PC portion is worked out (other than the USB). I'm guessing here, but is it converting the Arduino library to PBPro that is the "sticky wicket"? "Managed 57600" seems to indicate you can RX/TX, but haven't yet developed/ duplicated management functions from the library.

Re: HTML and PIC communication

It contains PHP. It isn't pure HTML.
So script need to be hosted on server.
You can use free server for testing.
eg: www.000webhost.com
This isn't ad, just sharing one that worked for me.
Try to create acc. And host script in some file with .php extension. eg script.php
Then you put in your browser address bar: https://blablabla.000webhostapp.com/....php?x=a&y=133
If you don't manage to do that, I could create some mail, and acc and setup script. Just to get it working.