<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[req.status_code]]></title><description><![CDATA[<p dir="auto">req = urequests.request(method='GET', url='<a href="http://xxx.de/Datum.txt" target="_blank" rel="noopener noreferrer nofollow ugc">http://xxx.de/Datum.txt</a>')<br />
print(str(req.status_code))</p>
<p dir="auto">The status code is displayed on the first pass, but not on the second pass. What could be the reason for this?</p>
]]></description><link>https://community.m5stack.com/topic/2628/req-status_code</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 04:36:50 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2628.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 20 Dec 2020 16:02:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to req.status_code on Mon, 21 Dec 2020 08:44:06 GMT]]></title><description><![CDATA[<p dir="auto">'''</p>
<h1>Update der Settingdaten holen---------------------------------------</h1>
<pre><code>    if (Verbindung) == 1 and wifiCfg.wlan_sta.isconnected(): #Nur bei bestehender Internet Verbindung
        print("-----------------------------------------------")
        print("Überprüfe ob es eine Online-Setting Datei gibt")
        try:

            try:
              req = urequests.request(method='GET', url=settings.Gateway+'onlinesettings.txt')
              print('onlinesettings.txt wurde auf vorhandensein überprüft')
              print(str(req.status_code))
              time.sleep(1)
            except:
              print('onlinesettings.txt ist nicht vorhanden')

            if (req.status_code == 200) :
                print('onlinesettings Uebertragung OK')

                if (ssd1306) == 1:
                    if (settings.Display) == 1:
                        lcd.print("Online Update, Setting erfolgt...",0,170,0xb8b8b8)               
                time.sleep(1) #Warte 1 Sekunden

                with open('/sd/settings.py', 'w') as updatefile:
                    updatefile.write(req.text)
                updatefile.close()
                print('onlinesettings wurde neu erstellt')
                time.sleep(1)
                
                #Datei wieder löschen-------------
                req = urequests.request(method='GET', url=settings.Gateway+'killsettings.php')
                print('Setting Datei wurde auf dem Server wieder geloescht')
                time.sleep(1)
                Setting_Online_Update = 1
                
            else:
                print('Keine Setting Datei vorhanden!')
                print("-------------------------------------------")                    
                

        except Exception as e:
            print('Fehler!')
            print(e)
</code></pre>
<h1>Update der Settingdaten holen---------------------------------------</h1>
<pre><code>    # On Off Einstellungen holen---------------------------------------
    if (Verbindung) == 1 and wifiCfg.wlan_sta.isconnected(): #Nur bei bestehender Internet Verbindung
        print("Überprüfe ob übers Internet ausgeschaltet wird")
        try:

            try:
              req1 = urequests.request(method='GET', url=settings.Gateway+'onoff.txt')
              print('onoff.txt wurde auf vorhandensein überprüft')
              print(str(req1.status_code))
              time.sleep(1)
            except:
              print('onoff.txt ist nicht vorhanden')

              if (req1.status_code == 200) :
                   print('onoff Uebertragung OK')
                   OnOff = 0 # An Aus Schalter = Aus
                    
                  #Datei wieder löschen-------------
                   req2 = urequests.request(method='GET', url=settings.Gateway+'killpoweronoff.php')
                   print('On-Off Datei wurde auf dem Server wieder geloescht')
                   time.sleep(1)
                    
              else:
                   print('Keine On-Off Datei vorhanden!')
                   print("-------------------------------------------")                        

        except Exception as e:
            print('Fehler!')
            print(e)
    # On Off Einstellungen holen---------------------------------------
</code></pre>
]]></description><link>https://community.m5stack.com/post/11324</link><guid isPermaLink="true">https://community.m5stack.com/post/11324</guid><dc:creator><![CDATA[Wolli01]]></dc:creator><pubDate>Mon, 21 Dec 2020 08:44:06 GMT</pubDate></item><item><title><![CDATA[Reply to req.status_code on Mon, 21 Dec 2020 08:18:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/wolli01" aria-label="Profile: wolli01">@<bdi>wolli01</bdi></a> can you please attach a complete code or if it's UIFlow could you attach a screenshot of your blocks? the python code will also help.</p>
]]></description><link>https://community.m5stack.com/post/11322</link><guid isPermaLink="true">https://community.m5stack.com/post/11322</guid><dc:creator><![CDATA[Zontex]]></dc:creator><pubDate>Mon, 21 Dec 2020 08:18:33 GMT</pubDate></item><item><title><![CDATA[Reply to req.status_code on Mon, 21 Dec 2020 07:47:22 GMT]]></title><description><![CDATA[<p dir="auto">Module is Core2.<br />
It runs in a loop While True:<br />
On the first run, everything runs correctly.<br />
From the second run on, the status code is no longer displayed. It is simply skipped!</p>
]]></description><link>https://community.m5stack.com/post/11321</link><guid isPermaLink="true">https://community.m5stack.com/post/11321</guid><dc:creator><![CDATA[Wolli01]]></dc:creator><pubDate>Mon, 21 Dec 2020 07:47:22 GMT</pubDate></item><item><title><![CDATA[Reply to req.status_code on Mon, 21 Dec 2020 02:45:27 GMT]]></title><description><![CDATA[<p dir="auto">Hello, what pass are you referring to? could you please provide the complete code including what Core module are you trying to run it on and the result you are getting? please use the ``` quotes when you write code such as:</p>
<pre><code>req = urequests.request(method='GET', url='http://xxx.de/Datum.txt')
print(str(req.status_code))
</code></pre>
<p dir="auto">Thanks</p>
]]></description><link>https://community.m5stack.com/post/11317</link><guid isPermaLink="true">https://community.m5stack.com/post/11317</guid><dc:creator><![CDATA[Zontex]]></dc:creator><pubDate>Mon, 21 Dec 2020 02:45:27 GMT</pubDate></item></channel></rss>