Author Topic: Help needed with Arduino compile errors  (Read 683 times)

Offline Jim Tittsler

  • Ringo Starr
  • *****
  • Posts: 1657
  • Gender: Male
    • Jim
Re: Help needed with Arduino compile errors
« Reply #45 on: August 14, 2019, 12:36:39 PM »
I have filled in the FILLMEIN parts Jim. There’s three  locations where various EUI code from TTN is filled in with the first two in little Endian and the last in big Endian and I paid careful attention to it being correct.
Screenshots in next message perhaps you missed spotting those lines in code?

The errors you posted in the earlier message occurred because you hadn't filled in the FILLMEIN.  But glad you have it sorted now.

And yes, the other messages appear to have just been warnings.  You could define i as an unsigned int which is probably what your IDE is using for size_t.

To repeat an earlier suggestion: screenshots are not a good way to seek help.  I encourage you to learn how to use git and one of the public source code hosting sites.  Or even just use GitHub Gists (or GitLab Snippets, etc.) if you can't show us the entire project.. that at least gets line numbering.
« Last Edit: August 14, 2019, 12:47:21 PM by Jim Tittsler »

Offline Robert Hancock

  • Ringo Bingo
  • *
  • Posts: 17535
Re: Help needed with Arduino compile errors
« Reply #46 on: August 14, 2019, 04:45:55 PM »
There’s a communication issue! The errors you linked to are just examples of spare# coding misses, etc.  The errors I have are 3 posts above that with three enumeration #1, #2, and #3 in red.  But whatever—point taken about using Git.
The errors I posted WERE/HAVEBEEN/ARE occurring with the FILLMEIN sections completed from the very first stage. I have NEVER NOT had those sections completed.
I’ll post something on git when I get back from work and can see what I need to post.
I really need the author of the code to look at it!
« Last Edit: August 14, 2019, 06:03:37 PM by Robert Hancock »
Quite an experience to live in fear, isn't it? That's what it's like to be a slave.

Offline Robert Hancock

  • Ringo Bingo
  • *
  • Posts: 17535
Re: Help needed with Arduino compile errors
« Reply #47 on: August 15, 2019, 06:40:45 AM »
At GIST private

https://gist.github.com/newkton1/aaf018e0a8ab9384556d404128ff6bed

Arduino LoraWan Sketch for Uno using Arduino ISP which compiles/uploads OK but Serial Monitor throws error at line 53 in oslmic.c


(Serial monitor screenshot attached)
« Last Edit: August 15, 2019, 06:46:15 AM by Robert Hancock »
Quite an experience to live in fear, isn't it? That's what it's like to be a slave.

Offline Morgan Fisher

  • Ringo Starr
  • *****
  • Posts: 3082
  • Gender: Male
    • My website
Re: Help needed with Arduino compile errors
« Reply #48 on: August 15, 2019, 10:15:22 AM »
This is a long one, isn't it!

I feel like saying, "Hey you two, get a room!" hahaha

Morgan

Offline Jim Tittsler

  • Ringo Starr
  • *****
  • Posts: 1657
  • Gender: Male
    • Jim
Re: Help needed with Arduino compile errors
« Reply #49 on: August 15, 2019, 10:18:01 AM »
Arduino LoraWan Sketch for Uno using Arduino ISP which compiles/uploads OK but Serial Monitor throws error at line 53 in oslmic.c

That looks related to the problem you had a couple of days ago.  radio_init() is failing (returning 0).  Suspect wrong address/pins/timing.  If you have the source for radio_init() look for what it is doing, what pins it is wiggling or what I2C/SPI commands it is sending or what address it is talking to.  Write a loop that does nothing but that... and then look with logic analyzer / oscilloscope / LEDs / multimeter (loop speed needs to be really slow for the last two  8)) to see what is going wrong.

Offline Robert Hancock

  • Ringo Bingo
  • *
  • Posts: 17535
Re: Help needed with Arduino compile errors
« Reply #50 on: August 15, 2019, 11:19:27 AM »
Beyond my pay grade and skill set I'm sorry to say.

It'd be cheaper in terms of lost hours/cost just to buy a commercial setup.

The reason I'm playing with this is because the caulking seal along the bath side panel edge with the tile floor fails silently (as my partner scrubs it vigorously to keep mold at bay) so a puddle of water up to 2-cm deep accumulates in the foundation under the bath until I re-caulk the bath. To check the flood conditions, I have to wriggle through a tiny floor trapdoor, which requires Houdini-level contortions, and then crawl 10 meters in a tight 45-cm high space until I get under the bath. (I am slightly claustrophobic so it requires will power and liquor to get me down there.)

I was hoping to put a capacitative water sensor on low-power battery LoRa in place and get it to send me radio messages via TTN about dryness or otherwise for a few years until the battery needs replacing.

However, on the + side I have learned a lot about how a basic Arduino system works and even a bit of C++ from looking at code.

Maybe I'll revisit this again when my patience returns and the author of the project returns from summer holiday.

What I find so depressing is that this is a published tutorial with open-source code and descriptions and wiring diagrams, which should have been easy to follow for someone with a little technical knowledge, but I have bumped into boards with damaged bootloaders, compile errors that come and go, serial-monitor errors, etc.

One last thing I will try is soldering the patch cords to the Arduino rather than use wiggly male/female connectors.

I am sure the pin mappings are correct because I went back to the original RFM95 and ATmega328P spec sheets and read them through and triple checked.  The tutorial documentation is correct on this point too.

Hmmmm.
Quite an experience to live in fear, isn't it? That's what it's like to be a slave.

Offline iTmX nee (RevX)

  • Ringo Bingo
  • *
  • Posts: 15837
  • Gender: Male
  • "O for a horse with wings!" Will Shakespeare
Re: Help needed with Arduino compile errors
« Reply #51 on: August 15, 2019, 11:26:37 AM »
Until you get a remote setup I'm happy to offer to crawl and check that space on one of my irregular visits to Tokyo and free for a coffee or tea.
"I've seen things you people wouldn't believe."

"Life lies in resolve for death"
Flight is the only truly new sensation than men have achieved in modern history.  ~James Dickey
"Goddamn, you play a mean banjo"

Offline Jim Tittsler

  • Ringo Starr
  • *****
  • Posts: 1657
  • Gender: Male
    • Jim
Re: Help needed with Arduino compile errors
« Reply #52 on: August 15, 2019, 04:05:46 PM »
It'd be cheaper in terms of lost hours/cost just to buy a commercial setup.

Or at least a LoRa module that was legal to use in Japan.  8)

Quote
What I find so depressing is that this is a published tutorial with open-source code and descriptions and wiring diagrams, which should have been easy to follow for someone with a little technical knowledge, but I have bumped into boards with damaged bootloaders, compile errors that come and go, serial-monitor errors, etc.

OK.  But just to be clear, the serial-monitor errors you have showed us are programmer's sanity checks that have failed.  You sprinkle ASSERTs throughout your code as you develop it. You make sure when you turn on a peripheral you can actually talk to it.  Or it responds to a certain kind of (artificial) stimulus.  Or a function given these parameters returns this result.1 Then when you are ready to ship, you flip one switch that makes all of the ASSERTs magically disappear in the compilation, and the production device or application suffers zero runtime cost in either space or time from your 'debugging.'  So the errors you have shown are more along the lines of: this is not working because some bad assumption/some misconfiguration/some hardware problem... and is alerting you that there is no point going any further until this gets sorted out.  The serial port messages are notices of real underlying problems that are not satisfying the original programmer's expectations. Your board is obviously not identical to theirs. Or is defective (which I suppose is the degenerate case of not being like theirs  8)).


1Some developers take this to an extreme for Test Driven Development.  You write the tests first that you know mimic the desired intermediate states and outputs... and then you write software to make each of the tests pass.

Offline Robert Hancock

  • Ringo Bingo
  • *
  • Posts: 17535
Re: Help needed with Arduino compile errors
« Reply #53 on: August 15, 2019, 05:05:14 PM »
This test set was with a bare RFM module soldered directly to the Arduino Uno as described here:

https://www.disk91.com/2019/technology/lora/hoperf-rfm95-and-arduino-a-low-cost-lorawan-solution/

I went back to the Elecrow Lora Radio Node that I managed to get the new bootloader uploaded to a few days ago and tried again as described here:
 
https://www.disk91.com/2019/technology/lora/first-steps-with-lora-radio-node-arduino/

The module he is using is identical to the module I have but his English is not great when describing details of shorting pins and mappings connections so I'm not surprised at the test result posted here:

https://gist.github.com/newkton1/da8cc2ff020ecdf8c434d513c692ca43

But at least it is not a clear error!

It seems the guy running the posts on the disk91 site is incommunicado (European holidays) and maybe the best thing is to communicate with him.

I had a devil of a job getting the Sketch uploaded to the Lora Radio module via an FTD1232 due to out-of-sync errors but found a site describing use of an RTS to RST patch cable via a 100 nF cap and it works every  time now.  Go figure.
« Last Edit: August 15, 2019, 05:30:37 PM by Robert Hancock »
Quite an experience to live in fear, isn't it? That's what it's like to be a slave.

Offline Jim Tittsler

  • Ringo Starr
  • *****
  • Posts: 1657
  • Gender: Male
    • Jim
Re: Help needed with Arduino compile errors
« Reply #54 on: August 15, 2019, 06:11:30 PM »
https://gist.github.com/newkton1/da8cc2ff020ecdf8c434d513c692ca43

But at least it is not a clear error!

Probably only because you aren't checking if the os_init() succeeded in this version of the sketch, and just blindly going along hoping it did.

(And you really don't want to be using those frequencies in Japan.  We are in the 92x range.)

Offline Robert Hancock

  • Ringo Bingo
  • *
  • Posts: 17535
Re: Help needed with Arduino compile errors
« Reply #55 on: August 15, 2019, 06:32:43 PM »
Yes, I'm just blindly relying upon the author of the tutorial who is European so he's using eu frequencies.
Here's a data point though.  Until today, I've been using 923.1 MHz settings with his code and it causes new compile errors that I don't see using the eu 868-MHz range. Specifically, when setting the frequencies to 923 MHz in various files as necessary, there are new compile errors related to Band Center not being specified and a loop error.
Essentially I've given up to do a lot more reading—just fretting at a wiggly tooth.
Quite an experience to live in fear, isn't it? That's what it's like to be a slave.

Offline Robert Hancock

  • Ringo Bingo
  • *
  • Posts: 17535
Re: Help needed with Arduino compile errors
« Reply #56 on: August 15, 2019, 06:38:54 PM »
End of thread
Quite an experience to live in fear, isn't it? That's what it's like to be a slave.