UART / console redirection - page 4 - General Discussion and Assistance - CHDK Forum supplierdeeply

UART / console redirection

  • 37 Replies
  • 23762 Views
*

Offline Ant

  • *****
  • 509
Re: UART / console redirection
« Reply #30 on: 24 / September / 2016, 18:23:16 »
Advertisements
Try it?
I just replaced cli.lua:
Code: [Select]
connected: Canon EOS M3, max packet size 512
con> mcamcon
ERROR: mcamcon failed
con 3> mcamcon EFLensCom.GetFocalLength
ERROR: mcamcon failed
con 4>

Quote
this means some thing is needed to enable the output
I found one thing before calling 0xFC32D612(its equivalent on  EOS M3), but it's not enougth.
This function leads somewhere to dryos core...

« Last Edit: 24 / September / 2016, 18:24:50 by Ant »

*

Offline reyalp

  • ******
  • 14080
Re: UART / console redirection
« Reply #31 on: 24 / September / 2016, 18:32:56 »
Try it?
I just replaced cli.lua:
Did you implement the camera side code?

For the cli code, you probably would be better off diffing and just adding the code that implements the specific command rather than replacing the whole file.

edit:
Looking at the chdkptp side code, some changes would need to be made, because I changed how error handling works in chdkptp since that was written. This means the con:exec(code,{libs='msg_shell'}) status check should be removed, if it fails, it will throw an error.  This explains why you got "failed" since it no longer returns a value.
Same for the write_msg call. I don't see any else that would obviously be a problem, but I haven't looked closely or tested.
« Last Edit: 24 / September / 2016, 19:00:29 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: UART / console redirection
« Reply #32 on: 16 / October / 2016, 09:53:07 »
Updated patches attached (no work done on D6, did not try a batch build either). Tried 'mcamcon drysh' on a3200, seems to be working.
IMHO, for this to become part of CHDK, the CHDK side code needs to be made 'on-demand', to avoid unnecessary memory overhead for regular users.

*

Offline srsa_4c

  • ******
  • 4451
Re: UART / console redirection
« Reply #33 on: 16 / October / 2016, 18:07:22 »
Update. I added a small fix for D6 and collected the necessary addresses for my sx280 102b. Console redirection works on that cam too (but it's - of course - impossible to switch between cores).


*

Offline reyalp

  • ******
  • 14080
Re: UART / console redirection
« Reply #34 on: 16 / October / 2016, 19:26:27 »
Thanks for working on this. Here's a small update for the chdkptp side. The only changes are to use readline if available, and clean up some error code that isn't needed any more.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14080
Re: UART / console redirection
« Reply #35 on: 23 / October / 2016, 16:03:35 »
Console redirection works on that cam too (but it's - of course - impossible to switch between cores).
Same on g7x. "sw" appears to have no effect, presumably it changes something at a lower level, like which core is connected to the UART. I haven't investigated the code for this command yet.

I also noticed that the standard UART output redirection (with uartr.lua) no longer works. This isn't a surprise, but possibly another argument for making the hook optional at run time.
Don't forget what the H stands for.

*

Offline Ant

  • *****
  • 509
Re: UART / console redirection
« Reply #36 on: 23 / October / 2016, 17:28:00 »
Can you post chdkptp binary and add changes to repository?

*

Offline reyalp

  • ******
  • 14080
Re: UART / console redirection
« Reply #37 on: 23 / October / 2016, 17:45:19 »
Can you post chdkptp binary and add changes to repository?
The patch above only changes lua code, so no new binary is required.

I generally do not add features to chdkptp if they depend on features that don't exist in the official CHDK source.

I haven't yet decided what to do with the CHDK side. I'm inclined to check in the chdk side (as a compile time option at least), but I need to spend some time re-familiarizing myself with the code.
Don't forget what the H stands for.


 

Related Topics