-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for ESP32C3 #18
Comments
after adding a few print statement I narrowed to this the section that cause the boot to fail
|
Oh and before I forget there was another strange thing : |
I have never looked at the console functionality to be honest, I've barely used it. That said, this sounds kind of weird indeed. |
Have you tried using a tool such as |
Try changing this line in your repo as seen in my commit to a test branch to see if it will help at all. Currently a few ESP32 targets are experiencing crashes like you are describing as far as I know. If that fixes it, then it proves it is probably stack issues across the board (as I expect). |
Thats how I narrowed it to the section of code mentionnes previoulsy but I have to dig deeper on the why. |
Console functionnality ? I'm not sure what you are refering to. I meant that I had to modify the code because there is a wifi hotspot functionnality (dont ask me why) and the ssid was set according to the bluettooth but since the code is modular and some boars dont have bluetooth the compilation crash for theses boards. |
Each RNode comes with the RNode Console, which hosts the source code for the repo and various other related Reticulum stuff. It does this over a wifi hotspot. This is what you had to change to get it to work. |
Did my fix on that branch work? |
I had no time yet to test it but will do that in the next few days. Since the crash occur in the setup function and not in the loop I dont know ifit will work but we will see :) |
If my reckoning is correct, it will. |
I did, and sadly it's not the issue that's blocking the boot, :( thanks for the help tho :) .
_spiModem.begin() was called Currently looking online if there is anything I missed regarding the ESP32C3 that would explain this behaviour |
this issue gave me the hint :) and this commit was the answer : nathmo@2217fe0 the node seems to work. I will do more testing. (I tried to set the stack to its original size and the node seems to behave normally. the led is steadily blinking and I can run `` rnodeconf /dev/ttyACM0 -i` |
btw how do I sign the firmware ? with unsigned.io down I can't find how to do it I guess there should be somehere that I can configure the EEPROM so that it shows the correct info but I can't quite get what to do.
|
I had a similar issue before, I know it sounds really stupid, but trust me, it's a stack issue. I had a freeze when the modem was being shut down via SPI before, tested it exactly the way you did. Don't trust your findings, they are a red herring. The stack is too small, (or something similar with memory) this is your actual problem. I will see if there is any way to make the stack larger in the setup routine for freeRTOS. |
Oh I am sorry, I didn't read your second comment, d'oh! Glad you fixed it!! |
no problem :) I'm currently trying to figure out how to connect my two rasperry pi over reticulum using the two Rnode I just made The device firmware dont seems to matter as it just print a huge warning (or I missed something) |
When you provisioned the EERPOM, which device did you use to do so? Did you use the device you are using to connect with it now? To explain, a key is generated on the machine using rnodeconf when the EEPROM is provisioned, and there is a signature written to the EEPROM which is created from some of the info in the EEPROM and the key. Because this is a locally generated key, it will be fine when connected to that machine (i.e. no errors), but with others this error will show. To fix the error, do as follows: Should fix the error. |
Only one key is currently trusted by default in |
If you are able to get communication working between these nodes, I will be surprised. Please let me know if it does work, if that's the case I'll need to change the code a bit. |
note 1) I realise there is some delay in github message :') now about the EEPROM provisioning, I tried to do it once (but it was three weeks ago and on another computer) I just ran : ``rnodeconf /dev/ttyACM0 --eeprom-wipe
I vaguelly recall that the first time I provisionned the EEPROM I had to read the python script of rnodeconf to understand what argugment where required and just tried with a random value. But I dont remeber seeing anywhere a full example of the syntax of the command to provision the EEPROM and what parameters influence what. ( --platform platform Platform specification for device bootstrap like where do I set the radio I have on board ? like power and frequency ? |
it's comming back to me now I think.
theses are the model code that represent the radio and hardware and last time I set it as unknown due to the inexistance of my board there. It's more something for the RNS side of things but it might be a good idea to separate the radio parameters from the board itself. especially if each new board require a pull request to the rnodeconf utility |
|
These are the only things you need to set to provision the EEPROM. Have you managed to communicate between the two boards successfully? :) |
Well if you need a hand I will be glad to assist. |
Haha. Please do feel free, especially some instructions on provisioning with |
no not yet I'm still rereading the rnodeconf code. trying to make this right. (what make you think I should have an issue making the two board communicating ?) |
I have a feeling your change will mean the modem isn't connected over SPI correctly, but I could be wrong. Given your RNode isn't complaining that it's not installed, it probably has managed to read the version, so it might be alright. Time will tell. |
okay I think I got it so for anyone that stumble upon this before a better documentation is written :
which return something like this
--hwrev is required (any integer between 1 and 255 should work)
and once you run the command you should have something like this :
currently that last command will crash due to finally if the query the node :
the said list :
|
@jacobeva so I tried and there is an issue. when I try to run rnsd I get an error that the software was unable to configure the radio
then I resetted the SPI line that I changed but now the device freeze and the RNS deamon cant open the serial port anymore
Do you have any other idea ? |
Change baud rate to 115200.
…On 24/08/03 02:36pm, Nathann Morand wrote:
![image](https://github.com/user-attachments/assets/9c9b4149-74c4-44f0-832d-c52b86b1de17)
this is what I get after each reboot (I rebooted 4 time in that screenshot)
--
Reply to this email directly or view it on GitHub:
#18 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
After realising that the ESP32-C3 could not detect reset the same way as the ESP32, it could also not enter the console. So my hunch was correct and it is due to a semaphore on the SPI bus This is progress
|
btw, this is for later but to fix the RNode console this might be a good start : espressif/arduino-esp32#8040 |
I think I might have a theory : sx127x::sx127x(uint8_t index, SPIClass spi,... I will now try to validate that theory by modifying the class and see if it fix it |
Well it allows the board to boot but I must have broken the radio initialisation (again) as I can't change the radio parameters. @jacobeva if you have an insight, I would be happy to hear it
|
You're probably right about this. I am currently working on another feature, but will investigate this issue ASAP once I am available. |
no stress. This is my vacation project and as much as it would give me some happy juice to make it work there are no stakes on that project. (plus I'm also working on it albeit slowly) |
An update: I am indeed retarded. Long story short, I had the exact same issue are you are currently having, but I also had memory corruption issues at the same time, which somehow trumped that and made things run (seemingly) okay, until I began adding extra features in the branch I am working on. I misinterpreted the semaphore issue (this was like a month ago now) to be a memory issue (which was also occurring), and thought it was fixed. In actual fact, it has been here the whole time still, hence your experience. So, I will roll out a fix today to allow for passing a pointer into the modem class when initialising it. This should resolve the issue and restore operation to your board (and probably a lot of other ESP32 boards as well). |
Well for your defense this is a nasty bug. Anyway I'm glad that it will actually solve more than one issue at once ( im trying to understand what the code do in details because I feel like having a basic programm with only the core functionnality would be a great plus, and being able to document that in a nice document would be even better because as of now, what happen between my terminal and the RF signal is pure magic to me :) |
It is a nasty bug, indeed. This is offtopic, but as you probably know by now this codebase isn't originally mine. I know it relatively well, but completing issue #1 and drawing up a document describing operation as you say, would be a good idea indeed. |
Commit 721cee3 should fix this SPI semaphore issue. Please copy your board config into that build, then test the updated firmware. It should fix the issue. |
I would love to do it but it's going to take me quite a while to catch up all you had to learn the hard way. Like what the RNode excpet as command, how does it accedt tge packet to transmit, what kind of processing does it do ? How does it deal with packet segmentation ? Is the Lora board running in "continuous" mode (where you can send a datastream as long as you want) or is in packet mode (I saw that in the modem datasheet but had no time to dig deeper) But remeber don't overwork yourself either it's an open source project your not paid it should be fun / interesting And we don't know much about each other skill level but I don't mind trying something if you can define it clearly :) |
well, I'm having the same result as when I tried to pass it by reference with my code :( The RNode boot, seems stable and answer command, but the radio is not doing what it should. this is the reticulum config
and this is the message when trying to run rnsd
but otherwise the node answer
|
This isn't right. Seems the frequency isn't being set properly. Have you made any progress with this at all? There is definitely not nothing coming out of the serial port. Reset the board and check again. If it doesn't print "No valid radio module found", then the modem isn't being initialised correctly. |
I can see default_spi is set to true. Try setting it to false and see if that makes any difference for you. |
I will try that. My last test was to use print statement to manually set the frequency and it works I can set the value. (but I dont remeber if the value was correct of not there might have been a factor that was wrong like the set frequency didnt apply the conversion from Hz to binary for the SX1278 correctly. I need to check again. will do in the next few days :)
|
to comment on the previous issue, my test works there is no conversion error. I can set the frequency and read it inside the programm. I'm trying to emulate the commande sent by the rnsd to change the frequency using a serial consol that send data as hex but the lack of documentation on the "API" make me wanna scream into the void and set my computer on fire while the universe laughs at my misery. the un commented misery :
like what is the syntax ? how do I read the config (frequency) ? how do I write the config ? the FEND smells like FRAME END which mean PACKET anyway this is just a rant.I will probably end up figuring it out but if you know stuff that I don't, feel free to light the way. in the meanwhile I will dig deeper |
it seems to me that when the host set the frequency the RNode will send that to the radio. and when the host read the frequency it come from the eeprom ??? I must have missed something |
Correct, except when the host reads the frequency, the RNodes get the value stored in the object of the modem the host is targeting. To explain, a typical KISS packet would look something like However, I don't think the issue lies here. I would say there is an issue with your SPI communication. Are you sure the pins you have set in the config are correct? It is also worth mentioning the pin config does not take affect if |
The KISS framing is certainly something I will be documenting in the future. As you say, it is rather confusing to those not in the know. |
and to be sure, the kiss standard is used to send the packet between the computer and the RNode even when the normal mode is used ? |
Not sure what you mean by normal mode. Do you mean connected to RNS through a serial port for example? If so, yes.
…On 14 August 2024 10:17:52 BST, Nathann Morand ***@***.***> wrote:
and to be sure, the kiss standard is used to send the packet between the computer and the RNode even when the normal mode is used ?
--
Reply to this email directly or view it on GitHub:
#18 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
Exactly. (by normal mode I meant even when it's not in TNC mode, since I assumed that the KISS standard was related to TNC) |
Hi, did you manage to get this working @nathmo ? |
No but for lack of trying. I'm in a motivation pitt... might try again later |
Hello again, have you had time to work on this at all? :) |
No :( i'm back at school and had no time to fiddle around. I will likely give it another crack this summer |
Hi there,
I'm trying to compile the firmware for the ESP32-C3 and a SX1278 (my goal is to make the cheapest RNode possible)
the wiring is rather simple :
this is my current progress :
https://github.com/nathmo/RNode_Firmware_CE/tree/master
I had to remove some dependency to unsigned.io which is down a lot lately for some reason.
I can build firmware, but the board is not behaving as it should (I get no answer from the rnode when I try to communicate with it using the rnodeconf tool) (the board was resetted / is not in programming mode and the serial port oppened correctly)
Also, I only get a solid LED instead of a blinking one.
If you have time, I would love to get your opinion on it (and a pointer on why the board is not answering)
If you want to test my code, look at the two pull request for the doc which should allow you to make one from scratch rather quickly if anything don't behave as expected please tell me.
The text was updated successfully, but these errors were encountered: