Sunray App connection issue solved / Sunray-App Verbindungsproblem gelöst ("Cross-Origin Request Blocked", CORS)

AlexanderG

Lawn robot freak and project co-founder
Teammitglied
Hello,
Recent Internet browsers block public Internet sites (like the Sunray-App) to access some private network site (like the robot). This restriction can be turned off:
  • Evothings Viewer/CGTech Viewer: no solution yet
  • Firefox: currently not affected (Firefox settings are available via browser URL line: "about:config", search for "security.fileuri.strict_origin_policy" and set it to "false")
  • Chrome: enter into browser URL line: "chrome://flags/#block-insecure-private-network-requests" and then disable this option
  • Edge: enter into browser URL line: "edge://flags/#block-insecure-private-network-requests" and then disable this option
  • Chrome: enter into browsler URL line: "chrome://flags/#block", search for "Secure private network requests" and disable this option
  • DuckDuckGo (Android/iOS/PC/Mac): currently not affected (runs out of the box)
This is a workaround until we found a more elegant solution (e.g. using cloud app) :)

Hallo,
Aktuelle Internet-Browser blockieren die Verbindung von öffentlichen Internet-Seiten (z.B. Sunray-App) ins Intranet (z.B. zum Roboter).
Die Restriktion lässt sich aufheben:
  • Evothings Viewer/CGTech Viewer: derzeit keine Lösung
  • Firefox: derzeit nicht betroffen (Firefox-Einstellungen sind erreichbar über URL-Zeile: "about:config", nach "security.fileuri.strict_origin_policy" suchen und auf "false" einstellen)
  • Chrome: im Browser als URL-Zeile eingeben: "chrome://flags/#block-insecure-private-network-requests" und dann die Option deaktivieren
  • Edge: im Browser als URL-Zeile eingeben: "edge://flags/#block-insecure-private-network-requests" und dann die Option deaktivieren
  • Chrome: im Browser als URL-Zeile eingeben: "chrome://flags/#block", nach "Secure private network requests" suchen und die Option deaktivieren
  • DuckDuckGo (Android/iOS/PC/Mac): derzeit nicht betroffen (läuft ohne Änderung an den Browser-Einstellungen)
Dies ist ein Workaround bis wir eine elegantere Lösung gefunden haben (z.B. über eine Cloud-App) :)


How to identify if the problem is related to Browser security (CORS) and not to a hardware issue?

In all browsers, you can activate the Developer Tools (CTRL+SHIFT+I), and then choose "Console" and reconnect to the robot. If the problem is related to Browser security, you will see a message like "Cross-Origin Request Blocked" (CORS), and you will have to disable it as described above. If you don't see a message related to CORS (like shown in red below), your connection issue is hardware-related! Additional tip: You can activate additional App debug information (like shown below) via the App menu ('...') and then choosing menu item 'DEBUG IS ON'.

Screenshot from 2022-05-24 20-32-33.png
 
Zuletzt bearbeitet:
Seit heute kann ich mich weder über FF noch über Chrome mit dem Ardumower verbinden.

neu-1.jpg

security.fileuri.strict_origin_policy steht auf false. Kann es noch eine andere Ursache haben?
 
Leider gibt es keine Möglichkeit einen echten Verbindungsfehler von einer Sicherheitsblockade zu unterscheiden (es ist verrückt, aber der Sicherheitsstandard sieht vor dass dies über die Browser-Schnittstellen nicht unterschieden werden darf - ich suche immer noch eine Möglichkeit dass ich diese beiden Fälle über die Browser-Schnittstelle unterscheiden kann - derzeit gibt es in beiden Fällen nur einen allgemeinen "Verbindungsfehler" über die Browser-Schnittstelle als Antwort). Ich vermute hier also einen allgemeinen Verbindungsfehler (und keinen "CORS"-Fehler)...
Wenn ich z.B. eine falsche IP-Adresse eintrage, erhalte ich übrings ebenfalls den "CORS"-Fehler in der Browser-Console! Für meinen Geschmack gehört die ganze "CORS"-Erfindung für Zugriffe auf das private Intranet abgeschafft oder idealerweise könnte der Browser doch den Benutzer einmal fragen ob dieser auf das private Intranet zugreifen darf... (so wie bei Kamera-Zugriffen etc.) :)
 
Zuletzt bearbeitet:
Bei mir geht Chrome ...

muss allerdings dazu sagen das ich noch eine grottenalte FW auf dem ESP habe.
 
Zuletzt bearbeitet:
Tip: if the Evothings Viewer App is crashing after installation/upgrade, delete the 'location permissions' in Android settings (for this App) and restart the App.
 
Have you ever thought about implementing a Web-Server into the ESP32 and providing the PC/Laptop Browser App access directly from the mower?

Is it not possible to implement the Sunray App code directly into the CGTech/Evothings Viewer to have one fixed app on the smartphone and a bluetooth access to the mower would be possible directly without needed internet access of the smartphone at app start time?

I think these could be possibilities to have everything local without needed rewriting of the app code.
 
Hallo zusammen,

Gute Nachrichten. Zusätzlich zu

Code:
Access-Control-Allow-Origin: *

können Server vielleicht bald auch

Code:
Access-Control-Allow-Local-Network: true
https://wicg.github.io/local-network-access/#headers

und im CSP noch

Code:
treat-as-public-address
https://wicg.github.io/local-network-access/#csp

festlegen. Damit könnte dieses Problem vielleicht bald gelöst werden, sollte der W3C Draft sich durchsetzen, aber bislang ist es nur ein Draft. Im Chrome Preflight scheint es drin zu sein, aber da heißt es noch Access-Control-Allow-Private-Network statt Access-Control-Allow-Local-Network: https://developer.chrome.com/blog/private-network-access-preflight/


Have you ever thought about implementing a Web-Server into the ESP32 and providing the PC/Laptop Browser App access directly from the mower?

Is it not possible to implement the Sunray App code directly into the CGTech/Evothings Viewer to have one fixed app on the smartphone and a bluetooth access to the mower would be possible directly without needed internet access of the smartphone at app start time?

I think these could be possibilities to have everything local without needed rewriting of the app code.
The Sunray App in the browser is connecting to the mower directly (at least that's what you can see from hitting F12 in the browser app), only checking license and getting the app files is using internet if you access it through your browser. The app version should be local except for the license check maybe (correct me if I am wrong). This is the reason the browser complains about insecure connections. It looks like an attack to the browser, e.g. scanning for the local router web interface. Storing the whole app onto the mower is also an option of course, this way there is no cross origin request, however you would need more memory for that, the ESP32 has only about 4-16MB flash memory and 320 KiB SRAM.
 
Zuletzt bearbeitet:
Hat sich irgendwas heute geändert?
Hab eben die Nachricht bekommen das die Lizenz zurückgesetzt wurde und auch alle Default Settings mit IPs waren wieder da.

Nach aktivieren der Lizenz bekomme ich jetzt aber keine Session mehr connected, selbst die Cam baut keine Verbindung mehr auf wegen vermeintlichen HTTPS Problemen.

.231 ist der Roboter
.230 ist die CAM die mit HTTP arbeitet und kein HTTPS kann

Browser Chrome mit dem gesetzten Flag aus dem ersten Post.
War die Webseite schon immer HTTPS?
Also hat sich da was geändert oder hat Chrome die Security Richtlinien hochgefahren das HTTPS Webseiten keine HTTP Inhalte mehr enthalten dürfen?

2023-08-26-17-54-26-Ardumower-Sunray-App.png
 
Zuletzt bearbeitet:
Firefox gleiche Probleme, kommen trotz dem gesetzten Flag in der about:config die CORS / Cross Origin Errors.
Vermute mal das gleiche Problem wie auch im Chrome mit dem Mix aus HTTPS und HTTP.

Kann das Jemand bestätigen?
Die App wie immer nicht betroffen, aber Steuerung per Browser am PC wäre wieder nett.
 
Bei mir war auch alles weg und musste meine Lizenz neu eingeben, aber danch läuft wieder alles (Browser Firefox).
 
Eben nochmal zweiten PC versucht, gleiche Problem, bekomme weder den Roboter noch die CAM connected.
Immer die gleichen Fehler im Log, vorher lief alles, nutze fast ausschließlich den Browser um den Roboter zu verfolgen.

@AlexanderG
Wurde am Wochenende irgendwas geändert?
Eventuell eine gewisse Sunray oder ESP32 Version Voraussetzung für eine erfolgreiche Verbindung?
Hab noch die 1.0.286 im Einsatz.

@W1976
Falls Alex das Forum nicht mehr liest, kannst du das eventuell mal an ihn herantragen?
 
Hi eRacoon. lt Alexander hat sich nichts geändert am Lizenz Server. Kann es sein das die wo Probleme bekommen haben, der jeweilige Browser upgedatet wurde?

Alexander hat folgendes geschrieben: "hallo - nein, lizenztechnisch hat sich nichts geändert - die browser-sicherheitsstandards ändern sich jedoch teilweise mit jeder neuen browser-version und lassen keinen mix von https und http zu ..."
 
Die Lizenz funktioniert auch problemlos, aber bekomme weder mit Chrome noch Firefox eine Connection aufgebaut aktuell.
Lizenz war nur erwähnt weil die sich resettet hat am Wochenende, also irgendwas muss auf Server Seite ja gewesen sein.

Jemand nen Tipp das auf Win11 irgendwie nativ zum laufen zu bekommen?
Gibt es irgendeine "App" als Vergleich zum Evo Viewer?

Generell wäre eine supportete Version mit modernen Apps und OS's nett, kann ja keine Lösung sein das man nur eine Connection aufbauen kann via einer App die seit Jahren keine Updates mehr gesehen hat.
Die Evo Viewer Android App ist von 2016 und wird von einigen Android Geräten auch gar nicht mehr im Google Store supportet, muss man dann via externe .apk Quelle installieren.
 
Zuletzt bearbeitet:
War gerade dabei wild alle Browser am durchprobieren und zack genau in diesem Moment ist die Seite auf einmal auf http:// umgesprungen und hat wieder alle Daten resettet. Jetzt laufen auch direkt wieder alle Browser wie zuvor.
 
Für den Mähplaner musst du die aktuelle aus dem Masterzweig (Github Entwicklerzweig) installieren, da für den Mähplaner auch die Firmware angepasst wurde. Aber die läuft meiner Meinung noch nicht perfekt. Manchmal dreht sich der Ardumower recht schnell an den GPS Punkten, oder schwänzelt mehr.
 
Oben