GadgetReboot / Phone_SLIM

POTS Telephone Subscriber Line Interface Module
Creative Commons Attribution Share Alike 4.0 International
16 stars 1 forks source link

Various errors loading Sketch #1

Open DAN-GITHUB-ACCESS opened 1 month ago

DAN-GITHUB-ACCESS commented 1 month ago

Hello Gadget Reboot, I am contacting you here because I did not find any other information.

I ordered 5 Phone Line Simulator (POTS Land Line) boards from PCBWAY.

I would like to customize it so that I have a button. When I press the button the phone starts ringing. When the phone is answered, a greeting and then music is played from an SD card. If it is not answered, the ringing will stop after 5 times.

I haven't done that much with Arduino and not with such complex sketches.

But my problem is that when I want to load your sketch. Many errors are displayed that modules are missing.

Would it be possible to get a sketch where all modules are included and the required #INCLUDE is not .

Thx Danny

GadgetReboot commented 1 month ago

I don't know a lot about software so I was lucky to get everything working and I know things can break if new libraries are released or different board files for the chip being used. What errors did you get?
I will try to flash the sketch in a newer Arduino IDE setup and see if it works easily or what I needed to do to get libraries installed.

GadgetReboot commented 1 month ago

I just installed the latest Arduino IDE fresh on a clean system that has never had any of the files on it so there would be no residual things that get overlooked. The first thing I'd try is verify which version of the ESP32 board file you are using because somewhere after the version 1 series, things started giving compile errors. I used ESP32 board file version 1.0.6 and a bunch of weird errors went away. If you use a newer board file you can temporarily downgrade to 1.0.6 and then upgrade again after, or set up a different IDE for using weird occasional configurations. I don't know why the errors are there or if they're due to other libraries not working well together so I just lived with the dependency.

Here's the long list of exactly what I did from scratch:

SLIM_node Sketch Upload from scratch Install Arduino IDE 2.3.2 Download sketch and unzip in folder called SLIM_node, and open the sketch in the IDE Configure Arduino IDE for ESP32 board file support following instructions on Espressif page, using Stable release link in Arduino preferences board manager URL https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html Then in Arduino IDE menu Tools/Board/Boards Manager, search for ESP and install ESP by espressif 1.0.6 Newer board files cause compile errors Choose the correct ESP32 board in Tools/Board/ESP32/DOIT ESP32 DEVKIT V1 Without having installed any other libraries yet, going step by step, clicking Verify to compile and check for errors, it can’t find RGBLed.h so installed that by going to https://github.com/wilmouths/RGBLed and clicking the green Code button, choose download zip and save it. In the IDE choose menu item Sketch, Include Library, Add .Zip Library. Navigate to the downloaded Zip file and click Open to install it. Compiling again, it can’t find ESPAsyncWebServer Install by going to https://github.com/me-no-dev/ESPAsyncWebServer and following the same procedure to download the zip and install the library. Compiling again, it can’t find AsyncTCP Install the same way from https://github.com/me-no-dev/AsyncTCP Compiling again, it can’t find ArduinoJSON Go to IDE menu Sketch/Include Library/Manage Libraries and search for ArduinoJSON by Benoit Blanchon. Install version 6.19.4 since this was the version used for testing originally. Compiling again, it can’t find MozziGuts. Install Mozzi by going to https://github.com/sensorium/Mozzi and installing the library zip file with previous methods Compile successful!

DAN-GITHUB-ACCESS commented 1 month ago

Hello Thank you for this fast answer.

Setup

Setup

Use Sketch from repository

Verify Sketch

Verify Sketch1

RGBLed.h highlighted in the sketch. RGBLed.h not included in the sketch folder

comment out

comment out

Verify Sketch

Verify Sketch2

ESPAsyncWebServer.h highlighted in the sketch. WiFi.h and ESPAsyncWebServer.h not included in the sketch folder

GadgetReboot commented 1 month ago

Yeah those libraries need to be installed by downloading the zip files the way I described in my clean setup yesterday and then it should compile.

DAN-GITHUB-ACCESS commented 1 month ago

Oh sorry, I didn't see the email at first. What is needed from the Mozzi .zip? everything ?

DAN-GITHUB-ACCESS commented 1 month ago

Thank you very much, it worked.

Last question. When I use the board with an external power supply. Can I still use the USB port on the board for programming at the same time, or do I just have to use USB?

GadgetReboot commented 1 month ago

Since the IDE is installing the whole zip library I just kept it all because it would probably break if I tried to delete files and it happens to need them. External power and usb can be plugged in at the same time because diodes on the ESP module as well as the board prevent any back feeding if multiple sources are in use.

DAN-GITHUB-ACCESS commented 1 month ago

Thank you again for your help and creating this board.

DAN-GITHUB-ACCESS commented 2 weeks ago

Can you give me some help again?

How can I start and stop the ringing on the same board. I only made it to the other board using a "sendTrunkMsg" message.

Thank you very much.

Am 01.06.2024 um 17:28 schrieb GadgetReboot @.***>:

Since the IDE is installing the whole zip library I just kept it all because it would probably break if I tried to delete files and it happens to need them. External power and usb can be plugged in at the same time because diodes on the ESP module as well as the board prevent any back feeding if multiple sources are in use.

— Reply to this email directly, view it on GitHub https://github.com/GadgetReboot/Phone_SLIM/issues/1#issuecomment-2143487538, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOFRYTXO7VY7BNRS6IPHJLTZFHSCXAVCNFSM6AAAAABIRXVZYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBTGQ4DONJTHA. You are receiving this because you authored the thread.

GadgetReboot commented 2 weeks ago

It's been a while since I was doing testing with just making a phone ring on one board and I can't find any test code so if I were looking to add some kind of extra feature to the main code, I'd check if there's a spare input pin available on the ESP32 I can use to trigger a ring (can't remember if there's extra pins now).

Then I'd add some extra conditions to the runStateMachine() part of the main INO sketch file to force a ring generating state as if someone were trying to call in from the other board.

There is a state called ringPhone that gets assigned to currState when an incoming call normally rings the phone so I'd want to trigger that state in a test mode.

So in the case Idle: part of the runStateMachine() function, there's some if-statements there that wait for an event to go do something besides sit waiting for a command. The last if-statement there looks like: if (remoteRequestType == INCOMING_CALL) {
clearRemoteNodeData();
enteringNewState = true; currState = ringPhone;
}

So I'd add a new if-statement right after that one that maybe does something like if (reading in that spare GPIO test-ring pin is low) { enteringNewState = true; currState = ringPhone;
}

Then there would be that extra way to make the local phone ring other than an income call message to ring it, by setting a spare pin low or whatever other method can be used to trigger it, and the state machine jumps to the phone ring part.

Then to make the phone stop ringing of course, just pick it up and hang it up, or else hack in more if-statements to look for something like another GPIO low level reading to make it stop.

It looks like the only unused gpio pins are 1 2 and 3 on the schematic, 1 and 3 are UART and pin 2 is the on board LED for the module, so just for an experiment maybe one of those three can be assigned as input with pull up at the end of the setup() function and read in during that new if-statement to check if it's low and do the test ring. I'd probably try gpio 2 (LED) since it is less likely to be used as an LED after the first setup lines of code (it's used to show when wifi is joined, which happens earlier in setup).

DAN-GITHUB-ACCESS commented 2 weeks ago

Thanks for the help.

My board automatically starts in server mode and I can use the pin for a button.

I have now found that when I set the trigger with the button, the circuit first needs a status change. idle -> off-hook -> idle. then the phone rings. So I would have to reinitialize the runStateMachine after pressing the button. But somehow that doesn't work.

Am 27.06.2024 um 20:38 schrieb GadgetReboot @.***>:

It's been a while since I was doing testing with just making a phone ring on one board and I can't find any test code so if I were looking to add some kind of extra feature to the main code, I'd check if there's a spare input pin available on the ESP32 I can use to trigger a ring (can't remember if there's extra pins now).

Then I'd add some extra conditions to the runStateMachine() part of the main INO sketch file to force a ring generating state as if someone were trying to call in from the other board.

There is a state called ringPhone that gets assigned to currState when an incoming call normally rings the phone so I'd want to trigger that state in a test mode.

So in the case Idle: part of the runStateMachine() function, there's some if-statements there that wait for an event to go do something besides sit waiting for a command. The last if-statement there looks like: if (remoteRequestType == INCOMING_CALL) { clearRemoteNodeData(); enteringNewState = true; currState = ringPhone; }

So I'd add a new if-statement right after that one that maybe does something like if (reading in that spare GPIO test-ring pin is low) { enteringNewState = true; currState = ringPhone; }

Then there would be that extra way to make the local phone ring other than an income call message to ring it, by setting a spare pin low or whatever other method can be used to trigger it, and the state machine jumps to the phone ring part.

Then to make the phone stop ringing of course, just pick it up and hang it up, or else hack in more if-statements to look for something like another GPIO low level reading to make it stop.

It looks like the only unused gpio pins are 1 2 and 3 on the schematic, 1 and 3 are UART and pin 2 is the on board LED for the module, so just for an experiment maybe one of those three can be assigned as input with pull up at the end of the setup() function and read in during that new if-statement to check if it's low and do the test ring. I'd probably try gpio 2 (LED) since it is less likely to be used as an LED after the first setup lines of code (it's used to show when wifi is joined, which happens earlier in setup).

— Reply to this email directly, view it on GitHub https://github.com/GadgetReboot/Phone_SLIM/issues/1#issuecomment-2195440211, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOFRYTXEKG5LDUDK6OHZRE3ZJRL25AVCNFSM6AAAAABIRXVZYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJVGQ2DAMRRGE. You are receiving this because you authored the thread.

DAN-GITHUB-ACCESS commented 2 weeks ago

I did it. I was able to work with "enteringNewState“.

Am 28.06.2024 um 17:14 schrieb uzn @.***>:

Thanks for the help.

My board automatically starts in server mode and I can use the pin for a button.

I have now found that when I set the trigger with the button, the circuit first needs a status change. idle -> off-hook -> idle. then the phone rings. So I would have to reinitialize the runStateMachine after pressing the button. But somehow that doesn't work.

Am 27.06.2024 um 20:38 schrieb GadgetReboot @.***>:

It's been a while since I was doing testing with just making a phone ring on one board and I can't find any test code so if I were looking to add some kind of extra feature to the main code, I'd check if there's a spare input pin available on the ESP32 I can use to trigger a ring (can't remember if there's extra pins now).

Then I'd add some extra conditions to the runStateMachine() part of the main INO sketch file to force a ring generating state as if someone were trying to call in from the other board.

There is a state called ringPhone that gets assigned to currState when an incoming call normally rings the phone so I'd want to trigger that state in a test mode.

So in the case Idle: part of the runStateMachine() function, there's some if-statements there that wait for an event to go do something besides sit waiting for a command. The last if-statement there looks like: if (remoteRequestType == INCOMING_CALL) { clearRemoteNodeData(); enteringNewState = true; currState = ringPhone; }

So I'd add a new if-statement right after that one that maybe does something like if (reading in that spare GPIO test-ring pin is low) { enteringNewState = true; currState = ringPhone; }

Then there would be that extra way to make the local phone ring other than an income call message to ring it, by setting a spare pin low or whatever other method can be used to trigger it, and the state machine jumps to the phone ring part.

Then to make the phone stop ringing of course, just pick it up and hang it up, or else hack in more if-statements to look for something like another GPIO low level reading to make it stop.

It looks like the only unused gpio pins are 1 2 and 3 on the schematic, 1 and 3 are UART and pin 2 is the on board LED for the module, so just for an experiment maybe one of those three can be assigned as input with pull up at the end of the setup() function and read in during that new if-statement to check if it's low and do the test ring. I'd probably try gpio 2 (LED) since it is less likely to be used as an LED after the first setup lines of code (it's used to show when wifi is joined, which happens earlier in setup).

— Reply to this email directly, view it on GitHub https://github.com/GadgetReboot/Phone_SLIM/issues/1#issuecomment-2195440211, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOFRYTXEKG5LDUDK6OHZRE3ZJRL25AVCNFSM6AAAAABIRXVZYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJVGQ2DAMRRGE. You are receiving this because you authored the thread.

GadgetReboot commented 2 weeks ago

Good that it worked - I'd have to get all back into the mindset to even remember how it all works after half a year away from it, and I don't have anything set up to even test with right now. I had to use the ESP modules in another project. But I'll be getting back at it maybe in a few months with a new audio switching board I now have so it can route calls between multiple nodes. It'll take a bunch of hacking and slashing of software before that gets working and I'll have to re-learn how the messages function so I can intercept them and use them for multi node routing.

DAN-GITHUB-ACCESS commented 2 weeks ago

Sounds interesting. Keep us informed about these cool things.

Am 29.06.2024 um 00:28 schrieb GadgetReboot @.***>:

Good that it worked - I'd have to get all back into the mindset to even remember how it all works after half a year away from it, and I don't have anything set up to even test with right now. I had to use the ESP modules in another project. But I'll be getting back at it maybe in a few months with a new audio switching board I now have so it can route calls between multiple nodes. It'll take a bunch of hacking and slashing of software before that gets working and I'll have to re-learn how the messages function so I can intercept them and use them for multi node routing.

— Reply to this email directly, view it on GitHub https://github.com/GadgetReboot/Phone_SLIM/issues/1#issuecomment-2197731952, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOFRYTTAJXG7XFWAJGAGM2TZJXPP3AVCNFSM6AAAAABIRXVZYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJXG4ZTCOJVGI. You are receiving this because you authored the thread.