internalError 0x800

Hello can anyone take a look of this message. here are something i dont understand.
1, channel not set( what channel)
2, 4196355 MM0 MC0 IE2048 IEC1 TN:rcou
3, WDG: T-3 SL0 FL129 FT3 FA0 FTP181 FLR80C2CC1 FICSR

details as following,

2021/10/29 20:10:06 : channel not set
2021/10/29 20:10:06 : Lua: /APM/scripts/LED_poslight.lua:19: LEDs right:
2021/10/29 20:10:06 : GPS: u-blox 1 saving config
2021/10/29 20:10:06 : 4196355 MM0 MC0 IE2048 IEC1 TN:rcou
2021/10/29 20:10:06 : WDG: T-3 SL0 FL129 FT3 FA0 FTP181 FLR80C2CC1 FICSR
2021/10/29 20:09:56 : IMU0: fast sampling enabled 8.0kHz/2.0kHz
2021/10/29 20:09:56 : RCOut: DS150:1-2 PWM:3-12 NeoP:13
2021/10/29 20:09:56 : MatekF765-Win 0027002A 30385102 3935333
2021/10/29 20:09:56 : ChibiOS: 934d4202
2021/10/29 20:09:56 : ArduPlane V4.2.0dev (51ccc182)
2021/10/29 20:09:56 : IMU0: fast sampling enabled 8.0kHz/2.0kHz
2021/10/29 20:09:56 : RCOut: DS150:1-2 PWM:3-12 NeoP:13
2021/10/29 20:09:56 : MatekF765-Win 0027002A 30385102 3935333
2021/10/29 20:09:56 : ChibiOS: 934d4202
2021/10/29 20:09:56 : ArduPlane V4.2.0dev (51ccc182)
2021/10/29 20:09:56 : channel not set
2021/10/29 20:09:56 : Lua: /APM/scripts/LED_poslight.lua:19: LEDs right:
2021/10/29 20:09:56 : 4196355 MM0 MC0 IE2048 IEC1 TN:rcou
2021/10/29 20:09:56 : WDG: T-3 SL0 FL129 FT3 FA0 FTP181 FLR80C2CC1 FICSR
2021/10/29 20:09:56 : IMU0: fast sampling enabled 8.0kHz/2.0kHz
2021/10/29 20:09:56 : RCOut: DS150:1-2 PWM:3-12 NeoP:13
2021/10/29 20:09:56 : MatekF765-Win 0027002A 30385102 3935333
2021/10/29 20:09:56 : ChibiOS: 934d4202
2021/10/29 20:09:56 : ArduPlane V4.2.0dev (51ccc182)

At a minimum, your LED_poslight.lua script is failing at line 19, probably because there’s a channel variable that is not initialized.

Thank you. Yuri. your answer remind me. I think I have 2 lua scripts that I can only have one running(the error was gone once I took 1 of the 2 lua script away). I am not sure if I get it right. do you know how to assign a switch to get choosing more than one script to run.

You could set and check for the SCR_USER* parameters in each script and include logic that would cause the script to exit if the parameter is set to a “disable” value of your choosing.

would that be possible to use it as a switch to turn on the LED light and off. is it possible to give an example by how to set scr_user(can’t assocaite its numbers with specific settings)

It’s not really clear what you’re trying to do at this point, but here’s an example of how to use the SCR_USER* parameters in a script:

USER_VAR  = 'SCR_USER1'
FREQUENCY = 100
STANDBY   = 0
DO_FOO    = 1
DO_BAR    = 2

function foo()
    gcs:send_text(6, 'Foo activated')
    param:set(USER_VAR, STANDBY)
end

function bar()
    gcs:send_text(6, 'Bar activated')
    param:set(USER_VAR, STANDBY)
end

function update()
    local user_val = param:get(USER_VAR)

    if user_val == DO_FOO then
        foo()
    end
   
    if user_val == DO_BAR then
        bar()
    end

    return update, FREQUENCY
end

return update()

Thank you for your answer.

Sorry, I did not make it clear. I was trying to assign a switch to turn on and off a script which this script is for the ws2812 LED.

The user example you give. Did not show which switch was assigned this script.

The example was to show you how to poll for a changing parameter and use it in your script.

You could instead poll for an RC PWM value and use that to change the state of your LEDs or force the LED script to exit upon detection of that PWM value.

What you can’t do directly is launch a script from a switch, button, or RC input. They are all loaded at boot time.

Read the documentation.

Have a look at the numerous examples.

I have read the links you give for many times, but my computer knowledge really limits to my understanding.

I can understand this part.

This is exactly what I wanna do, but I never get a success.

Please provide a dataflash log (.bin)

sorry, the logs probably were deleted.

the waring was gone where lua script removed from the tf card. I don’t know why…

@Yuri_Rage
@peterbarker
Can you take a look of this log.

The led lua can be switch on by the vtx switch on low power. and it change the colors as the roll changes. and stop changing color when vtx switch is at mid power or high power. and the led will not be off again whatever the vtx switch changes.I did not assign this function. can you tell what make it like this?

I received the message of failsafe couple of time of the reason 3. but the rssi is being normal. the plane change the course little bit then back to normal. I don’t know what is happening.

@peterbarker
I think I found the bin file that makes internalError 0X800 warning.

2021-11-12 14-30-47.bin (680 KB)

Your other thread is directly related to this one, so linking it here.

Lua scripting LED lights switch on by vtx power switches - ArduPlane - ArduPilot Discourse

I think you have an electrical problem, possibly related to your VTX power supply. Your autopilot isn’t monitoring board voltage that I can see in your log, so I’m just going by your description as well as a couple of very strong current spikes that drop your battery below 13.5V at times. The failsafe you’re experiencing looks like a radio failsafe, which I think may be related.

If your autopilot is rebooting when you power your VTX on and off, it’s almost certainly a power supply issue. Either your battery isn’t up to the task, the bus from which your drawing VTX power is not suitable, or your have mis-wired in some other way.

You’ll want to solve these issues before trying to power even more peripheral hardware like LEDs.

Perhaps one of the team more experienced with Plane firmware can take a look at the logs and see if I’m missing anything.


As for your Lua script problems, you are trying to use a script that has LEDs on two channels, one for the left side and one for the right. According to the messages in your first post, you only have LEDs on one output pin, so that script will not work for you.

How many LEDs are connected?
What, exactly, do you want them to do?

I’m going to agree with @Yuri_Rage, there is something wrong with the plane’s power system.

The voltage and current readings should be smooth lines, but the log is showing crazy oscillations that I’ve never noticed before. At points the voltage is oscillating 0.5v, and 6 amps. That’s a lot.

You need to figure out if this is just a sensor issue, or if it’s real. If these power oscillations are real then there’s going to be no shortage of gremlins in your plane. (reboots, failsafes, etc…) For starters, disconnect everything that’s not critical for flight: VTX, Camera, LEDs, and any other gear you may have installed. Then see if the oscillations are still there. If that clears it up, add things back one by one until you isolate the problem. If it doesn’t clear it up, then get into your wiring and components. Do you have a bad or poor connection somewhere? Do you have a bad filter capacitor or Do you need to install a filter capacitor? Do you have a component that is failing?

thank you for your answers.

The vtx power is from the matek765wing. and the battery is 21700. it drop the voltage when the current gets big. but it basically works fine for my other planes

I did some test this afternoon. I unplug the vtx. the reboot with vtx switch issue was still there. I disable the LED script. the problem was gone. but the failsafe still happens. I am going to unable the lua script (scr_enable=0)again and continue to test tomorrow.

I did not know it was two channel. it changes the color from one end to the other end. it works fine on the another plane of mine. and there was only one connection on the matekF765wing board.
for this plane it has 11 LEDs are connected.
I would have them turned on if I can assign a switch. I do night fly sometimes and I need it on so I can the plane in the dark.

thank you allister,

This is what I did this afternoon. but looks I need to try more options to find out what is wrong. I have assembled a new battery(21700 with 2p4S). since you told me the power drop problem last time of launching problem. and I tried on other normal plane first. it was fine.

I have added capacitor on the both esc with each one of 1000uf. The flgiht board was sent back to the factory for a test. and result was fine. the rest of components will be a long list. I need to think about it.

can you tell me how to you get this displaying?
https://discuss.ardupilot.org/uploads/default/original/3X/e/8/e84edd936b4893fae932c8b07e34907c18a3a694.jpeg

APM Planner on MacBook.