<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Сохранение переменных в EEPROM]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=2118&amp;type=atom" />
	<updated>2026-02-09T15:31:55Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=2118</id>
		<entry>
			<title type="html"><![CDATA[Сохранение переменных в EEPROM]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=6357#p6357" />
			<content type="html"><![CDATA[<p>Хочу настроить сохранение переменных в EEPROM.<br />Написал код <br /></p><div class="codebox"><pre><code>#define REMOTEXY_MODE__ESP32CORE_BLE

#include &lt;BLEDevice.h&gt;
#include &lt;EEPROM.h&gt;

#define REMOTEXY_BLUETOOTH_NAME &quot;RemoteXY_i36_wroom&quot;
#define REMOTEXY_ACCESS_PASSWORD &quot;123&quot;


#include &lt;RemoteXY.h&gt;

#pragma pack(push, 1)  
uint8_t const PROGMEM RemoteXY_CONF_PROGMEM[] =   // 117 bytes V21 
  { 254,96,0,0,0,0,0,3,0,0,51,0,51,11,0,62,33,0,97,0,
  21,0,0,0,0,13,1,106,200,1,1,7,0,7,36,3,68,11,102,64,
  2,26,2,51,129,3,4,24,11,64,17,83,83,73,68,0,129,3,18,27,
  11,64,17,80,65,83,83,0,7,36,17,68,11,102,64,2,26,2,11,129,
  3,32,28,11,64,17,116,111,107,101,110,0,7,36,31,68,11,102,64,2,
  26,2,33,1,76,53,26,14,1,2,31,114,101,115,101,116,0 };
  
struct {

    // input variables
  char edit_ssid[51]; // string UTF8 end zero
  char edit_pass[11]; // string UTF8 end zero
  char edit_token[33]; // string UTF8 end zero
  uint8_t button_reset; // =1 если кнопка нажата, иначе =0, oт 0 до 1

} RemoteXY;   
#pragma pack(pop)
 

void setup() 
{
  RemoteXYEngine.addGui (RemoteXY_CONF_PROGMEM, &amp;RemoteXY, REMOTEXY_ACCESS_PASSWORD)-&gt;addConnection (new CRemoteXYStream_BLEDevice (REMOTEXY_BLUETOOTH_NAME)) ;
  
EEPROM.begin(RemoteXYEngine.getEepromSize()); // init EEPROM
  
}

void loop() 
{ 
  RemoteXYEngine.handler ();   

  if (RemoteXY.button_reset == 1) {
    RemoteXY.button_reset = 0;
    Serial.println(&quot;Reset button pressed, restarting ESP32-C3...&quot;);

    delay(1000);
    ESP.restart();
  }
  

}</code></pre></div><p>На ESP32 WROOM все отлично работает и сохраняет. Тот же код на ESP32C3 Super mini запускается, но ничего не сохраняет. После перезагрузки пусто</p>]]></content>
			<author>
				<name><![CDATA[ohotnik13]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=267</uri>
			</author>
			<updated>2026-02-09T15:31:55Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=6357#p6357</id>
		</entry>
</feed>
