|
Forum Index : Microcontroller and PC projects : Pi-cromite 5.4.12, UDP messaging support
| Author | Message | ||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10565 |
Please find attached version 5.4.12. This now includes full support for UDP messaging and conversion of internet addresses: 2017-10-17_080857_mmbasic-stretch.zip 2017-10-17_080909_mmbasic-jessie.zip ![]() The picture shows an interaction between a Pi Zero W, running Jessie (top) and, on the bottom, a Pi 3 running stretch The Pi zero is configured as a UDP server listening on port 6001. It tries to receive a message but there is nothing there (the port number of the client is set to zero and the message itself and the client address are blank strings). The RECEIVE command is non-blocking and always returns immediately. It tries to send a message but can't because there is no client The client then sends a message and the server repeats the read command. In this case the message is received and the server reports the message and who sent it. At this point the server knows the address and receive port for the client and can now send a message. The server sends the message and the client successfully receives it. Note on the client screen the use of the function GETIP$() to return the IP address for www.thebackshed.com I'll update the manual later today and post it to this thread |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9749 |
Crikey..... Please, matherp, NEVER leave these forums....... Smoke makes things work. When the smoke gets out, it stops! |
||||
| atmega8 Guru Joined: 19/11/2013 Location: GermanyPosts: 727 |
Cool, but why do we need two different versions?: 2017-10-17_080857_mmbasic-stretch.zip 2017-10-17_080909_mmbasic-jessie.zip |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10565 |
I got reports that once I moved to Stretch users were seeing strange errors when running on Jessie based machines |
||||
| atmega8 Guru Joined: 19/11/2013 Location: GermanyPosts: 727 |
Do you let us know the reason for this behavior and what is the difference in the „code“? THX |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10565 |
No idea. The code is the same the only difference is the version of Raspbian running on the build host - may be a different version of GCC? In any event the executables are different size so there is some sort of difference - just use the version that is relevant to the version of Raspbian on you Pi |
||||
| atmega8 Guru Joined: 19/11/2013 Location: GermanyPosts: 727 |
Thanks Peter, very strange issue. However, your Baby works and we can communicate via Network. Very very 😎 Thank you. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10565 |
Updated 5.4.12 manual attached: 2017-10-18_112554_Pi-cromite_Manual.pdf |
||||
| Micro-80 Newbie Joined: 03/03/2017 Location: Russian FederationPosts: 26 |
Thanks Peter! This is a wonderful and quickly done job! |
||||
| disco4now Guru Joined: 18/12/2014 Location: AustraliaPosts: 1044 |
Hi Peter, I am not sure how hard it is, but would it be possible to call SUBs and Functions from the command line once a program is loaded. It currently thinks all not valid commands are an attempt to load a file. This helps when debugging etc. ![]() Also another small one. The SYSTEM command returns the last line of the output twice from what I am seeing.e.g SYSTEM "ls -al" shows the last file twice. Regards Gerry F4 H7FotSF4xGT |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10565 |
This appears to be an either/or We can either be able to execute programs as a single command or execute internal subroutines/functions. My instinct is to make the change to run internal functions. You can always execute a program from disk with "RUN filename" Views? Fixed, will post update once decision on above is confirmed |
||||
| disco4now Guru Joined: 18/12/2014 Location: AustraliaPosts: 1044 |
I like the 'RUN filename' option and the ability to call SUBs and Functions from the command line as part of testing/debugging. Regards Gerry F4 H7FotSF4xGT |
||||
MicroBlocks![]() Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Maybe it is nice to add support for MQTT (http://mqtt.org/ ) It is a simple protocol for transmitting messages between controllers. It is not a UDP but it uses TCP/IP. The Pi could function as a broker/server or as a client. Lots of drivers/software etc available on the above website. Microblocks. Build with logic. |
||||
| bigfix Senior Member Joined: 20/02/2014 Location: AustriaPosts: 129 |
I also think MQTT is one missing piece in the MicroMite Universe As only the Picromite has real networking - this is the place to ask for it I would love to have it also available for the plain MicroMites - Net Frontend ? In ESPterm it is on the ToDo List - but my hopes are limited with just me asking... ESPTerm Thread A client implementation is all which is needed For a server there is Mosquitto and other available solutions Lot of sensors and actors are on Ebay based on ESP8266 which support MQTT over Wifi Search for Itead Sonoff - dirt cheap and open source enhanced code is available Many people seem to use Tasmota as alternative SW for Sonoff Devices Tasmota GitHub There you find a pointerlist to all Sonoff devices Having a MQTT Client integrated in MMbasic would enable very interesting automated home solutions |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10565 |
![]() This shows the Pi-cromite publishing to a MQTT broker (server) running on a linuxmint virtual machine running under VMware on my PC. The subscribing client is also running on the linuxmint VM No need for any changes to the Pi-cromite code. Note the use of single quotes for the message Just install the mosquitto client on the raspberry pi running mmbasic sudo apt-get install mosquitto-clients |
||||
| bigfix Senior Member Joined: 20/02/2014 Location: AustriaPosts: 129 |
My most optimistic guess was that you solve this in less than a week But I forgot about the power of a real OS & MMbasic hybrid, you created here ! So all the lowlevel stuff like keepalive is handled in the Mosquitto client outside MMbasic - right ? To get a realtime state of the subscribed topic into MMbasic I need to issue the relevant system commands in regular intervals - basically polling the Mosquitto client ? Not directly related to MQTT - but to Picromite Is there any chance/plan that we get a "virtual" display on a webpage, which looks like one of the supported displays in MMbasic with GUI Command support Maybe even a realtime mirror of an attached physical display Reading the display bitmap and publishing it as web-picture Getting Mouse/Touch events "ored" to the real touchscreen I guess performance may be low, but with a multicore Pi3 ??? |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10565 |
Yes, but I haven't found how to do a non-blocking poll with mosquitto_sub. You can set the count of messages "-C 1" so that it terminates after it sees the first message but there doesn't appear to be a timeout. I assume this is just a limitation of the mosquitto client. Using mmbasic to publish though is trivial as per the example. This is sort of do-able now, just save the screen with IMAGE SAVE and then use the HTML server functionality to serve the image to a requesting web-browser as a background. Then position HTML transparent buttons etc over the background in the requisite places. Code the HTML server in MMBasic to respond to the GET requests indicating "GUI" activity. Lots of user code and HTML outside of my competence but do-able |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |