Shop OBEX P1 Docs P2 Docs Learn Events
Receiving serial stream from P1 on Raspi, need web page GUI — Parallax Forums

Receiving serial stream from P1 on Raspi, need web page GUI

Actually, it's bidirectional. Send command to P1 via web GUI, display data received.

My question is what software stack do I use on the Pi to provide the page in web browser?

What is out there that isn't a pig to learn, and looks current and is stable?

Comments

  • Heater.Heater. Posts: 21,230
    node.js https://nodejs.org/en/

    With Javascript under node.js you can:

    1) Create a web server in 10 or so lines of code. Especially if you use nodes Express module to help https://expressjs.com/

    2) Send and receive data to your serial port, hence P1, in another ten lines of code. Use the node serialport module for that https://www.npmjs.com/package/serialport

    3) Communicate in real time, streaming both ways, in another ten lines of code using web sockets. I use the socket.io module to make that even easier: https://socket.io/

    All this is dead easy to learn and use and pretty damn stable. I have systems using this stack that have been running in production for years now. We push data from sensors and such in real-time to graphs and status indicators in web dashboards.

    Of course that leaves the issue of actually creating the web page you want. That is a whole other can of worms. There are now a billion libraries and frame works for creating user interfaces in the page. I'm coming to the conclusion that the easiest thing to do, at least to start with, is ignore all that and just use JS in the browser to talk directly to the browsers DOM API.

    Except, I recommend bootstrap to take care of styling. Saves most of that messing around with the monster that is CSS: https://getbootstrap.com/docs/4.0/getting-started/introduction/

    As far as I can tell, if you really want to communicate with a client at a browser and a device (P1) attached to a server, both ways, in real-time, node.js is a much easier solution than dealing with traditional web servers, like Apache, and crusty old scripts in PHP.






  • Thanks for the lay of the land Heater. Appreciated.

  • Heater. wrote: »
    Is there any ready-made code for dealing with the Propeller, a loader for example?

  • Heater.Heater. Posts: 21,230
    edited 2017-09-21 08:22
    Almost. https://github.com/ZiCog/propeller-loader.js

    I started working on a Propeller Loader in Javascript, for node.js, a while back : https://github.com/ZiCog/propeller-loader.js Derived from your PLoadLib.c as it happens. Thank you.

    It did actually communicate with the Propeller boot loader but did not get as far as loading a binary. I had to put it aside under pressure of work at the time. And then well, other things came along.

    Perhaps I should get back to it.



  • David BetzDavid Betz Posts: 14,516
    edited 2017-09-21 11:13
    Heater. wrote: »
    I started working on a Propeller Loader in Javascript, for node.js, a while back : https://github.com/ZiCog/propeller-loader.js Derived from your PLoadLib.c as it happens. Thank you.
    To give credit where it is due, PLoadLib.c was actually written by jazzed. I built propeller-load around it. Thanks for the link to your Javascript loader.
  • Heater.Heater. Posts: 21,230
    Ah yes, thank you to jazzed.

    Where is he by the way?
  • David BetzDavid Betz Posts: 14,516
    edited 2017-09-21 12:54
    Heater. wrote: »
    Ah yes, thank you to jazzed.

    Where is he by the way?
    He seems to show up here from time to time. I suspect he's busy with other things like many here. Lots of people have either disappeared or cut down their participation considerably. Maybe things will pick up when the P2 silicon arrives.

  • Heater.Heater. Posts: 21,230
    I was hoping to meet up with Jazzed this summer whilst in San Jose. We were so damn busy there all the time though.
  • David Betz wrote: »
    Heater. wrote: »
    Ah yes, thank you to jazzed.

    Where is he by the way?
    He seems to show up here from time to time. I suspect he's busy with other things like many here. Lots of people have either disappeared or cut down their participation considerably. Maybe things will pick up when the P2 silicon arrives.

    I resemble that remark!

    Suffice to say with my other idea in the general microcontroller functions closed, I figure I'd wander past and see what others are doing and since I've got a something or other in the water with the Prop 1 business especially since I need to come up with something amazing for this Winter's Demo Day meet with Hack A DAY-NYC. One of them involves the TRS-80 Model 102 I've got here. And it runs out from there......
  • David Betz wrote: »
    Heater. wrote: »
    Ah yes, thank you to jazzed.

    Where is he by the way?
    He seems to show up here from time to time. I suspect he's busy with other things like many here. Lots of people have either disappeared or cut down their participation considerably. Maybe things will pick up when the P2 silicon arrives.

    I resemble that remark!

    Suffice to say with my other idea in the general microcontroller functions closed, I figure I'd wander past and see what others are doing and since I've got a something or other in the water with the Prop 1 business especially since I need to come up with something amazing for this Winter's Demo Day meet with Hack A DAY-NYC. One of them involves the TRS-80 Model 102 I've got here. And it runs out from there......

    Model 102? I have one of those. What are you doing with it?

  • I have a 100. :D
  • We've had students make little web pages with the ES8266 on a WX board. Usually used on an ActivityBot. They have some tutorials for this on Learn.
  • David Betz wrote: »
    David Betz wrote: »
    Heater. wrote: »
    Ah yes, thank you to jazzed.

    Where is he by the way?
    He seems to show up here from time to time. I suspect he's busy with other things like many here. Lots of people have either disappeared or cut down their participation considerably. Maybe things will pick up when the P2 silicon arrives.

    I resemble that remark!

    Suffice to say with my other idea in the general microcontroller functions closed, I figure I'd wander past and see what others are doing and since I've got a something or other in the water with the Prop 1 business especially since I need to come up with something amazing for this Winter's Demo Day meet with Hack A DAY-NYC. One of them involves the TRS-80 Model 102 I've got here. And it runs out from there......

    Model 102? I have one of those. What are you doing with it?

    Two things. One is to have it work as a terminal for program that pretends to be a PDP-11 running one of their operating systems. For the Prop 1, the device would be emulating a specific model PDP-11.

    The other is my ongoing project of having the Model 102 talk to the Raspberry Pi and do a convincing job of it.

    The really big problem here is outdoing myself. That Hack A DAY-NYC is convinced I'm e-mail address's namesake and once that happens it is difficult to keep up. The crowd keeps expecting the near impossible.
  • [One is to have it work as a terminal for program that pretends to be a PDP-11 running one of their operating systems. For the Prop 1, the device would be emulating a specific model PDP-11.
    Are you saying you're writing a PDP-11 emulator for the P1? That sounds really interesting. One of the first big assembly language programs I wrote back in the 70's was a PDP-11 emulator that ran on a PDP-8.

  • TorTor Posts: 2,010
    Prop-11..
    Or Prop-8, and run your PDP-11 emulator on it!

    :)
  • Tor wrote: »
    Prop-11..
    Or Prop-8, and run your PDP-11 emulator on it!

    :)
    Hmmm... two layers of emulation? Maybe I should run this under Dave Hein's SpinSim so we have three layers.
  • **Writes this as there is a parade of California to NY walking robots going by.**

    Hello!
    Close. I was originally thinking of having the Prop 1 emulate a specific PDP-11 model. However I remembered that I had one firm's product here, and one group's collection of emulators.

    Visit D-BIT that's the company.

    The second one is SIMH currently the active site isn't really being there so the Owner has it pointing to the site belonging to the great people at Bit-Saver's current address. Pick the mirror for SIMH that you want.

    Basically there you go.
  • **Writes this as there is a parade of California to NY walking robots going by.**

    Hello!
    Close. I was originally thinking of having the Prop 1 emulate a specific PDP-11 model. However I remembered that I had one firm's product here, and one group's collection of emulators.

    Visit D-BIT that's the company.

    The second one is SIMH currently the active site isn't really being there so the Owner has it pointing to the site belonging to the great people at Bit-Saver's current address. Pick the mirror for SIMH that you want.

    Basically there you go.
    Yeah, I know about SIMH but that's cheating! :-) I'd like to write my own emulator. Of course, I'm sure I'll never get around to it. What OS are you planning on running on your emulated PDP-11?
  • David Betz wrote: »
    **Writes this as there is a parade of California to NY walking robots going by.**

    Hello!
    Close. I was originally thinking of having the Prop 1 emulate a specific PDP-11 model. However I remembered that I had one firm's product here, and one group's collection of emulators.

    Visit D-BIT that's the company.

    The second one is SIMH currently the active site isn't really being there so the Owner has it pointing to the site belonging to the great people at Bit-Saver's current address. Pick the mirror for SIMH that you want.

    Basically there you go.
    Yeah, I know about SIMH but that's cheating! :-) I'd like to write my own emulator. Of course, I'm sure I'll never get around to it. What OS are you planning on running on your emulated PDP-11?

    Hello!
    Excellent question. XXDP to confirm for my needs that the emulation works. It's a diagnostic that DEC wrote to confirm that the lucky machine was unpacked correctly. Then it's a toss up between a variety of UNIX, or if I can figure out how to get networking to work, BSD.
    --
    But why are you wearing that ball cap, and why is that cat next to you flipping through a magazine of questionable meaning? The bot in back of you has been watching you and is posting its video streams.

  • David Betz wrote: »
    **Writes this as there is a parade of California to NY walking robots going by.**

    Hello!
    Close. I was originally thinking of having the Prop 1 emulate a specific PDP-11 model. However I remembered that I had one firm's product here, and one group's collection of emulators.

    Visit D-BIT that's the company.

    The second one is SIMH currently the active site isn't really being there so the Owner has it pointing to the site belonging to the great people at Bit-Saver's current address. Pick the mirror for SIMH that you want.

    Basically there you go.
    Yeah, I know about SIMH but that's cheating! :-) I'd like to write my own emulator. Of course, I'm sure I'll never get around to it. What OS are you planning on running on your emulated PDP-11?

    Hello!
    Excellent question. XXDP to confirm for my needs that the emulation works. It's a diagnostic that DEC wrote to confirm that the lucky machine was unpacked correctly. Then it's a toss up between a variety of UNIX, or if I can figure out how to get networking to work, BSD.
    --
    But why are you wearing that ball cap, and why is that cat next to you flipping through a magazine of questionable meaning? The bot in back of you has been watching you and is posting its video streams.
    My memories of the PDP-11 revolve around RT-11 or RSX-11-S. I suppose those are still proprietary operating systems though.

  • Heater.Heater. Posts: 21,230
    Oh, what? What happened to the SIMH site?

    My 8080/Z80 simulators for the Prop relied on SIMH AltairZ80 project for CP/M, bootloader etc.

    A phew, Peter Schorn still has his Altair pages : http://schorn.ch/altair.html

    Every things seems to me intact.


  • Heater. wrote: »
    Oh, what? What happened to the SIMH site?

    My 8080/Z80 simulators for the Prop relied on SIMH AltairZ80 project for CP/M, bootloader etc.

    A phew, Peter Schorn still has his Altair pages : http://schorn.ch/altair.html

    Every things seems to me intact.

    Right now? I can ask on their list if you want, glowing one, but I can guess. Right now people are recommended to download the stuff from the GIT site that one of the coders has grown. Kits of course from the SIMH site.

    I suspect they are in hibernation whilst the site is updated with fresh stuff. However Peter's site is not effected because it is not connected. And people are told to visit his site or another one if they want more of anything else for CP/M.

    Besides, for my efforts I typically argue with SIMH on the Raspberry Pi, and the DBIT application for DOS and Linux.

    I still haven't worked out how to restore a nice set of disk images that the fellow who provided the domain name originally for SIMH. That is the hosting functions and the portion after the SIMH beginning. These are from the TUHS site.
    ----
    That's strange. Did you know Heater you wrote that one wearing a baseball hat advertising of all things a cricket club that plays in and around Arsenal, and with a big gray tom of a cat. Note the wiggle motions of the camera device of the bot in the corner.

  • Heater.Heater. Posts: 21,230
    Buck Rogers,

    Good to hear there is an effective SIMH salvage operation going on.

  • I'm a bit late to the conversation, but another powerful and easy to use web tool is Node-Red. It is installed by default with Raspbian operating system. https://nodered.org/
Sign In or Register to comment.