DCC-EX / Support-Planning

DCC++EX Repo to hold project planning documentation and processes
1 stars 1 forks source link

Ticket Submitted via Website #531

Closed fire-bot closed 1 year ago

fire-bot commented 1 year ago

Sent by (dccextended@gmail.com). Created by fire.


Alan created a ticket

Name: Alan Kitching

Email: alan.kitching@outlook.com

Timezone: 0

Software: EX-CommandStation

Version: 4.0.x

Title: Wifi does not work in AP mode

Description: If I setup the Command Station to connect to my home network it works fine and I can control trains using Engine Driver. However I need to use it in another location so it needs to operate in AP mode. I have reloaded the software numerous times with no success. The DCCEX ssid does not appear. If I put my home network details back in it again works. The config.h file that I think it uses (in Temp\Arduino-sketch.......\sketch) is attached and as far as I can see that look ok.

Remaining email Quota: 100


Attachments:

  1. config.h
Kcsmith0708 commented 1 year ago

For AP mode your config.h file should look like this

define WIFI_SSID "Your network name"

define WIFI_PASSWORD "Your network passwd"

define WIFI_HOSTNAME "DCC-EX"

Because the ESP will remember the last WIFI_SSID you connected to it will continue connecting to the home SSID until you move far away enough for it not to see it.

On the command line Send <+RESTORE>

Then reboot the command station and you should see a new SSID on your phone DCCEX_nnnnnn six alphanumeric characters. Sign your phone on to that SSID with PASS_nnnnnn same six characters (case sensitive) and then it will Appear as a Discovered Server on your Throttle App.

habazut commented 1 year ago

Plesse send startup log (as printed on USB serial) when it goes to STA mode but you want it in AP mode instead.

Harald.

FrightRisk commented 1 year ago

/**

The configuration file for DCC-EX Command Station

**/

///////////////////////////////////////////////////////////////////////////////////// // NOTE: Before connecting these boards and selecting one in this software // check the quick install guides!!! Some of these boards require a voltage // generating resistor on the current sense pin of the device. Failure to select // the correct resistor could damage the sense pin on your Arduino or destroy // the device. // // DEFINE MOTOR_SHIELD_TYPE BELOW ACCORDING TO THE FOLLOWING TABLE: // // STANDARD_MOTOR_SHIELD : Arduino Motor shield Rev3 based on the L298 with 18V 2A per channel // POLOLU_MOTOR_SHIELD : Pololu MC33926 Motor Driver (not recommended for prog track) // FUNDUMOTO_SHIELD : Fundumoto Shield, no current sensing (not recommended, no short protection) // FIREBOX_MK1 : The Firebox MK1
// FIREBOX_MK1S : The Firebox MK1S // IBT_2_WITH_ARDUINO : Arduino Motor Shield for PROG and IBT-2 for MAIN // | // +-----------------------v //

define MOTOR_SHIELD_TYPE STANDARD_MOTOR_SHIELD

///////////////////////////////////////////////////////////////////////////////////// // // The IP port to talk to a WIFI or Ethernet shield. //

define IP_PORT 2560

///////////////////////////////////////////////////////////////////////////////////// // // NOTE: Only supported on Arduino Mega // Set to false if you not even want it on the Arduino Mega //

define ENABLE_WIFI true

///////////////////////////////////////////////////////////////////////////////////// // // DEFINE WiFi Parameters (only in effect if WIFI is on) // // If DONT_TOUCH_WIFICONF is set, all WIFI config will be done with // the <+> commands and this sketch will not change anything over // AT commands and the other WIFI defines below do not have any effect. //#define DONT_TOUCH_WIFI_CONF // // WIFI_SSID is the network name IF you want to use your existing home network. // Do NOT change this if you want to use the WiFi in Access Point (AP) mode. // // If you do NOT set the WIFI_SSID and do NOT set the WIFIPASSWORD, // then the WiFi chip will first try to connect to the previously // configured network and if that fails fall back to Access Point mode. // The SSID of the AP will be automatically set to DCCEX. // If you DO set the WIFI_SSID then the WiFi chip will try to connect // to that (home) network in station (client) mode. If a WIFI_PASSWORD // is set (recommended), that password will be used for AP mode. // The AP mode password must be at least 8 characters long. // // Your SSID may not contain ``"'' (double quote, ASCII 0x22).

define WIFI_SSID "Your network name"

// // WIFI_PASSWORD is the network password for your home network or if // you want to change the password from default AP mode password // to the AP password you want. // Your password may not contain ``"'' (double quote, ASCII 0x22).

define WIFI_PASSWORD "Your network passwd"

// // WIFI_HOSTNAME: You probably don't need to change this

define WIFI_HOSTNAME "DCCEX"

//

define ENABLE_WIFI true

// WiFi will be enabled (Mega only). The default channel is set to "1" whether // this line exists or not. If you need to use an alternate channel (we recommend // using only 1,6, or 11) you may change it here.

define WIFI_CHANNEL 1

///////////////////////////////////////////////////////////////////////////////////// // // ENABLE_ETHERNET: Set to true if you have an Arduino Ethernet card (wired). This // is not for Wifi. You will then need the Arduino Ethernet library as well // //#define ENABLE_ETHERNET true

///////////////////////////////////////////////////////////////////////////////////// // // DEFINE STATIC IP ADDRESS OR COMMENT OUT TO USE DHCP // //#define IP_ADDRESS { 192, 168, 1, 200 }

///////////////////////////////////////////////////////////////////////////////////// // // DEFINE LCD SCREEN USAGE BY THE BASE STATION // // Note: This feature requires an I2C enabled LCD screen using a Hitachi HD44780 // controller and a commonly available PCF8574 based I2C 'backpack'. // To enable, uncomment one of the #define lines below

// define LCD_DRIVER for I2C address 0x27, 16 cols, 2 rows // #define LCD_DRIVER 0x27,16,2

//OR define OLED_DRIVER width,height in pixels (address auto detected) // 128x32 or 128x64 I2C SSD1306-based devices are supported. // Use 132,64 for a SH1106-based I2C device with a 128x64 display. // #define OLED_DRIVER 128,32

// Define scroll mode as 0, 1 or 2 // #define SCROLLMODE 0 is scroll continuous (fill screen if poss), // #define SCROLLMODE 1 is by page (alternate between pages), // * #define SCROLLMODE 2 is by row (move up 1 row at a time).

define SCROLLMODE 1

///////////////////////////////////////////////////////////////////////////////////// // DISABLE EEPROM // // If you do not need the EEPROM at all, you can disable all the code that saves // data in the EEPROM. You might want to do that if you are in a Arduino UNO // and want to use the EX-RAIL automation. Otherwise you do not have enough RAM // to do that. Of course, then none of the EEPROM related commands work. // // #define DISABLE_EEPROM

///////////////////////////////////////////////////////////////////////////////////// // REDEFINE WHERE SHORT/LONG ADDR break is. According to NMRA the last short address // is 127 and the first long address is 128. There are manufacturers which have // another view. Lenz CS for example have considered addresses long from 100. If // you want to change to that mode, do //#define HIGHEST_SHORT_ADDR 99 // If you want to run all your locos addressed long format, you could even do a //#define HIGHEST_SHORT_ADDR 0 // We do not support to use the same address, for example 100(long) and 100(short) // at the same time, there must be a border.

///////////////////////////////////////////////////////////////////////////////////// // // DEFINE TURNOUTS/ACCESSORIES FOLLOW NORM RCN-213 // // According to norm RCN-213 a DCC packet with a 1 is closed/straight // and one with a 0 is thrown/diverging. In DCC++ Classic, and in previous // versions of DCC++EX, a turnout throw command was implemented in the packet as // '1' and a close command as '0'. The #define below makes the states // match with the norm. But we don't want to cause havoc on existent layouts, // so we define this only for new installations. If you don't want this, // don't add it to your config.h. //#define DCC_TURNOUTS_RCN_213

// By default, the driver which defines a DCC accessory decoder // does send out the same state change on the DCC packet as it // receives. This means a VPIN state=1 sends D=1 (close turnout // or signal green) in the DCC packet. This can be reversed if // necessary. //#define HAL_ACCESSORY_COMMAND_REVERSE

// If you have issues with that the direction of the accessory commands is // reversed (for example when converting from another CS to DCC-EX) then // you can use this to reverse the sense of all accessory commmands sent // over DCC++. This #define likewise inverts the behaviour of the command // for triggering DCC Accessory Decoders, so that <a addr subaddr 0> generates a // DCC packet with D=1 (close turnout) and <a addr subaddr 1> generates D=0 // (throw turnout). //#define DCC_ACCESSORY_RCN_213 // // HANDLING MULTIPLE SERIAL THROTTLES // The command station always operates with the default Serial port. // Diagnostics are only emitted on the default serial port and not broadcast. // Other serial throttles may be added to the Serial1, Serial2, Serial3 ports // which may or may not exist on your CPU. (Mega has all 3) // To monitor a throttle on one or more serial ports, uncomment the defines below. // NOTE: do not define here the WiFi shield serial port or your wifi will not work. // //#define SERIAL1_COMMANDS //#define SERIAL2_COMMANDS //#define SERIAL3_COMMANDS

/////////////////////////////////////////////////////////////////////////////////////