Photon Wifi selector software

Hi I am getting the following error when I compile photon. 2 years ago I did not have this issue
mas-july-30-1.cpp:63:21: variable 'Header h' has initializer but incomplete type

error

mas-july-30-1.cpp:85:19: invalid use of incomplete type 'struct Writer'
This part of code enables the users to set their WIFI credentials

Are you sure you have your Photon selected as the build target?

If using the Web IDE, it has a gold star to the left of the name. If using Workbench, it's configured with Particle: Configure project for device.

struct Writer is declared incomplete in softap_http.h, which you probably have included in your source that uses SoftAP. But the definition will only be resolved on the Photon and P1 platforms, as no other devices have SoftAP and won't have the full declaration.

Thanks Sir, I had forgotten to select the the relevant Photon. Yes I am using Web IDE. I have always had another question to ask but I did not want to bother you.
When I make changes in my code, the save button does not turn on, So how do I save the changes? Thanks

I believe that's a bug in the Web IDE. You should be able to use Ctrl-S (Windows, Linux) or Cmd-S (Mac) and it should save, even if the button is grayed out. Clicking the Verify button may also work, and will also save before verifying.

Thanks again, Ctr-S on windows works fine

Sir FYI, Clicking Verify did not save the firmware. I lost a lot of changes I had made and was unable to retrieve it

I have another question if I may,
On my old Photon board I have the following Pin allocations for PWMs
PWM1, TX, Pin3
PWM2 WKP, Pin5
PWM3, A5, Pin7
PWM4, A4, Pin8
It used to work in the past but now after updating to the latest OS and setting up WiFi, PWM2 is no longer working. I am using Web IDE

I also need to tell my end users how to set up a new WiFi, so that thy will not be able to update OS nor change the product name, Sorry guys I had an answer for this question, but I can not find it now
FYI I am having problems setting a new WiFi using the soft App as I did before
Thanks a lot

If PWM2, WKP problem is do to the Latest OS. Then I need to know how to revert back to the 2023 or 2022 OS version. Because I have invested a lot on building lots of boards and I am not able to change the pin allocations.

Please help
Thanks a million

The instructions to downgrade Device OS are here. It's easy if you can connect the device by USB, exceptionally difficult OTA.

Thank you sir. If I understand you correctly the problem is with the latest OS
Am I right?
Is there a USB base software for my end users to input new WiFi in to the Photon without having the options of OS upgrade nor changing the product name?

To complete the above question, I would need the same link for the Photon2 also please. Thanks

Wait, is this for a Photon 1 or Photon 2?

The Photon 2 does not have SoftAP. And there is essentially only one PWM timer on the Photon 2 - all PWM pins can have different duty cycles but all share the same frequency. And the pins are completely different than the Photon 1.

There is no known change in Device OS for Photon 1 that would have affected the WKP pin and PWM. What version did you have before, and what version of Device OS are you targeting now?

I am taking about Photon 1, I had OS V 2.3.1, after updating through my PC, I changed it back to 2.3.1 but still not working!!. and restore type is Tinker (Factory default ). There are 2 other restore type but I do not understand them. Any way I am badly stuck please help.
I have tried other older OS versions with no results

You're using the Web IDE, correct? Use Device Restore to downgrade Device OS over USB. In the Web IDE, Click on the Device icon, find the selected device (gold star before it), click the >, then set the target Device OS version to the downgraded version.

If you are using Particle Workbench, just target the older version using Particle: Configure Project for Device and then Particle: Flash application & Device OS (local).

Sir I had no problem going back to OS V 2.3.1 with Tinker option but it did not solve the PWM2 problem. I am using Web IDE. I connected Photon 1 to my PC through USB cable. Is there any solution for this issue?

There is likely something wrong with your software or your circuit. I tested PWM on the WKP pin on a Photon 1 using Device OS 2.3.1 and 3.3,1 and it works as expected.

#include "Particle.h"

SYSTEM_MODE(AUTOMATIC);

SYSTEM_THREAD(ENABLED);

SerialLogHandler logHandler(LOG_LEVEL_INFO);

const pin_t TEST_PIN = WKP;

void testPwm();

void setup()
{
    pinMode(TEST_PIN, OUTPUT);
}

void loop()
{
    testPwm();
    delay(5000);
}

static const int frequencies[] = {100, 500, 2000};
static const size_t frequenciesCount = sizeof(frequencies) / sizeof(frequencies[0]);

static const int dutyCycles[] = {0, 15, 50, 128, 255};
static const size_t dutyCyclesCount = sizeof(dutyCycles) / sizeof(dutyCycles[0]);

void testPwm()
{
    for(size_t frequenciesIndex = 0; frequenciesIndex < frequenciesCount; frequenciesIndex++) {
        for(size_t dutyCyclesIndex = 0; dutyCyclesIndex < dutyCyclesCount; dutyCyclesIndex++) {
            analogWrite(TEST_PIN, dutyCycles[dutyCyclesIndex], frequencies[frequenciesIndex]);
            delay(1000);
        }
    }
}

Thanks Sir. FYI I had a problem with my PCB, possibly because of the PCB track capacitance or resistance I was not getting any signal on PWM2, WKP.
I used a different board which is 98% the same as the bad one and the problem went away.
Sorry Sir I am bringing all my problems to you. My soft APP for allowing end users to input their WIFI credentials used to work 2 years ago but not working now. I received this soft app from a gentleman in our community. It is an HTML base app.
Would you help me out please thanks

I received SoftAP HTTP pages. It says since 0.5.0 I think it means OS V0.5.0
so it may not work on latter OS versions. If I am correct then what is the solution?

The Soft AP examples works on Photon 1 and P1 on all supported version of Device OS, currently 2.3.1 on the 2.x line and 3.3.1 on the 3.x line.

I was using my Samsung phone to connect to my photon soft app, but it was not working
when I used another Samsung phone it worked ok.
Thanks for all your help.
Best regards