Posts made by wolerdbon
-
RE: Multiple spaces are omitted
/* BASED UPON:
*-
GUI-O Basic Ethernet example (using ESP32-WROOM-32)
-
Copyright (C) 2022, GUI-O Team
-
SPDX-License-Identifier: BSD-3-Clause
-
see https://forum.gui-o.com/category/10/video-tutorials
*/// *** Amend as required ***
#include <WiFiNINA.h>// *** Amend as required ***
static const char *ssid = "XXXXXXXXXXXXXXXXX";
static const char *pass = "XXXXXXXXXXXXXXXXX";
WiFiServer server(XXXXX);
String in;
void setup() {
WiFi.begin(ssid, pass);
while(WiFi.status() != WL_CONNECTED) {
delay(500);
}
server.begin();
}void loop() {
WiFiClient client = server.available();
if(client) {
while(client.connected()) {
if(client.available()) {
const char c = client.read();
in += c;
if(c == '\n') {
parseGuioMsg(in, client);
in = "";
}
}
}
}
}void parseGuioMsg(const String &msg, WiFiClient &client) {
if(msg.startsWith("@init")) {
Serial.println("GUI-O app is requesting INITIALIZATION!");
client.println("@cls");
client.println("@guis BGC:#FFFFFF");
delay(100);// *** THIS IS WHERE THE MAGIC HAPPENS *** // *** Five labels of equal length are created and printed in monospaced font 10 client.println("|LB UID:title0 X:40 Y:10 TXT:\"title0 2 3 4 5 6\" FFA:\"font10\" FSZ:3.5"); client.println("|LB UID:title1 X:40 Y:20 TXT:\"title1 2 4 6\" FFA:\"font10\" FSZ:3.5"); client.println("|LB UID:title2 X:40 Y:30 TXT:\"title2 2 3 4 5 6\" FFA:\"font10\" FSZ:3.5"); client.println("|LB UID:title3 X:40 Y:40 TXT:\"title3 2 3 4 5 6\" FFA:\"font10\" FSZ:3.5"); client.println("|LB UID:title4 X:40 Y:50 TXT:\"title4 2 3 4 5 6\" FFA:\"font10\" FSZ:3.5"); client.println("|LB UID:title5 X:40 Y:80 TXT:\"- wait 5s... -\" FFA:\"font10\" FSZ:3.5"); // *** Naturally, all labels have the same length delay(5000); // *** The text of the lower four labels is changed client.println("@title2 TXT:\"title2 a b c d e\""); client.println("@title3 TXT:\"title3 a c e\""); client.println("@title4 TXT:\"title4 a c e\""); client.println("@title5 TXT:\" ? ? ? \""); // *** title2, title3 and title5 should be the same length. title4 should be wider // *** please refer to screenshot: multiple spaces get reduced to a single space
}
client.flush();
} -
-
Multiple spaces are omitted
It took me some time to track this issue. After nailing it down I have created the enclosed short sample Arduino sketch for demonstration. Screenshots of the screen output are also attached. After ‘init’ the text will change after 5 seconds to illustrate the problem.
It appears:
At the time of creation of the labels the multiple spaces within the strings are honoured. However, if the text of the labels is changed later multiple spaces are discarded and replaced by a single space. I have tried escaping the spaces and replacing them by Unicode, but it seems the system will not be trickedTested on Arduino IDE 1.8 and 2.X. Boards ESP32S3 and Nano 33 IOT. Windows 10 PC. Current Guio App running on Samsung Tab S6 Lite with current Android. Connection via WiFi.
Cheers -
Ethernet re-connect after MCU reboot
Since I am not a professional programmer: Sorry if this is obvious and I am wasting your time Maybe you could point me in the right direction.
Setup: GuiO on a tablet and ESP32S3 on local WiFi network, Arduino IDE to program the ESP32
How is re-connecting handled on a local Ethernet connection? It works fine for me via BT Classic or Serial, but not over WiFi on a local network.
My understanding is:
When the ESP32 reboots (i.e. after updating the Arduino sketch) Gui-O is oblivious to it having been away and sits around idly. Since the ESP32 only runs a server (and cannot act as client) it cannot instigate a new connection. So, the two cannot get together automatically?What works:
a) Restarting the GuiO app manually. It goes looking for the server, does the auto-connect, sends the “init” request and all works from there
b) I found a “Reset” button in the app. This works more conveniently, but I have not found a way to set the location of RST button, so it sits a little awkward over some other stuff
c) Is there another route I am missing? i.e. is there a port GuiO is listening to? So far I have (un-elegantly) been using the server on the esp32 to send instructions to the GuiO app, rather then using a client to connect to an unknown-to-me listener in the appIn another life, when the project is running, it’ll be fine. But while coding there is a frequent re-programming of the ESP32 and hence re-connecting
Also, it is also not the end of the world!
Greetings from Cologne
-
RE: Monospaced Font
@kl3m3n
Sweet! No more nightmares about jumbled text columnsThank you! I happily left you ***** on google play.
Greetings.
-
RE: Monospaced Font
@kl3m3n
Hi, these will do great; I look forward to the update.
Thank you for the quick response and action!
Greetings from Cologne -
Monospaced Font
G'day. I would appreciate if you added a ‘normal’ monospaced font, at times this helps to keep columns of text nice and tidy. Cascadia in Windows would be a good example, the dated 'classic' being Courier New.
|/"Otherwise a good app and 'pro' purchased without much hesitation. Thank you!/"