Re: Re:Re:Re: May I commit binary files into MM project?

2024-04-17 Thread Aleksander Morgado
Hey,

Sorry bother you again. In our local another PC, the way previous I used
> don't work by method 'sudo systemctl start ModemManager'.
> But command method 'sudo ModemManager' works.
> There are 2 attachments for reference.
> ModemManager.log was generated by command
>   'sudo ModemManager --debug --log-level=DEBUG'
> And ModemManager.service.log was generated by command
>  'sudo systemctl start ModemManager'
>
> We can see modem can attach to NW in ModemManager.log since Fcc Lock
> has been unlocked, even though there is no unlock message print(does it
> reasonable?). But in another log, we can see modem was stuck in state3 and
> state4.
>
>
Looks like in the case of the systemd service start, MM is not finding the
FCC unlock script for some reason? Try to enable debug MM logging in the
systemd service file, and check the filesystem paths reported by the daemon
where it's looking for the unlock script.


-- 
Aleksander


Re:Re:Re: May I commit binary files into MM project?

2024-04-15 Thread Slark Xiao
Good news! We renamed this script with format vid:pid and then it works.
Also, we can see the FCC lock related log with debug level now.
Thanks!

At 2024-04-13 17:28:45, "Slark Xiao"  wrote:
>
>Hi Aleksander,
>Refer to your advice, and the FCC unlock procedure page,we were merging our
>binary tool into the Debian test platform(Ubuntu). But we got a failure to
> unlock FCC.
>We put the script into the path /usr/lib/x86_64-linux-gnu/ModemManager/
>fcc-unlock.d. And this script will call our binary file FccLock in /usr/bin. 
>
>below is the script contents:
>
>#!/bin/sh
># require program name and at least 2 arguments
>[ $# -lt 2 ] && exit 1
>
># first argument is DBus path, not needed here
>shift
>
># second and next arguments are control port names
>for PORT in "$@"; do
>  # match port type in Linux 5.14 and newer
>  grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null && {
>MBIM_PORT=$PORT
>break
>  }
>  # match port name in Linux 5.13
>  echo "$PORT" | grep -q MBIM && {
>MBIM_PORT=$PORT
>break
>  }
>done
>
># fail if no MBIM port exposed
>[ -n "$MBIM_PORT" ] || exit 2
>
>UNLOCK_RESULT=1
>/usr/bin/FccLock -d /dev/$MBIM_PORT
>
>UNLOCK_RESULT=$?
>if [ $UNLOCK_RESULT -ne 0 ]; then
>  echo "SDX65 FCC unlock FAILED" >&2
>fi
>
>exit $UNLOCK_RESULT
>
>
>And we set the user and group of this file as root. Permission is 700.
>When we restart MM, we can find that device always being locked.
>But if we call this script with sudo, fcc lock would be unlocked right now. 
>I also checked the log of MM, and it seems no FCC related logs would be
>printed. Could you help me with some guidance and assistance?
>
>
>At 2023-09-22 21:09:45, "Aleksander Morgado"  wrote:
>>Hey
>>
>>> I have a concern about can we commit binary files into 
>>> /data/dispatcher-fcc-unlock folder?
>>
>>All the FCC unlock scripts/programs shipped by ModemManager are
>>GPLv2+. If you can distribute your program under the GPLv2+, we could
>>set it up to build from source along with the ModemManager project.
>>
>>If you want to dump a proprietary precompiled binary in the fcc-unlock
>>folder, the answer is "no" :)
>>
>>Cheers!
>>
>>-- 
>>Aleksander


Re:Re: May I commit binary files into MM project?

2024-04-15 Thread Slark Xiao

Hi Aleksander,
Refer to your advice, and the FCC unlock procedure page,we were merging our
binary tool into the Debian test platform(Ubuntu). But we got a failure to
 unlock FCC.
We put the script into the path /usr/lib/x86_64-linux-gnu/ModemManager/
fcc-unlock.d. And this script will call our binary file FccLock in /usr/bin. 

below is the script contents:

#!/bin/sh
# require program name and at least 2 arguments
[ $# -lt 2 ] && exit 1

# first argument is DBus path, not needed here
shift

# second and next arguments are control port names
for PORT in "$@"; do
  # match port type in Linux 5.14 and newer
  grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null && {
MBIM_PORT=$PORT
break
  }
  # match port name in Linux 5.13
  echo "$PORT" | grep -q MBIM && {
MBIM_PORT=$PORT
break
  }
done

# fail if no MBIM port exposed
[ -n "$MBIM_PORT" ] || exit 2

UNLOCK_RESULT=1
/usr/bin/FccLock -d /dev/$MBIM_PORT

UNLOCK_RESULT=$?
if [ $UNLOCK_RESULT -ne 0 ]; then
  echo "SDX65 FCC unlock FAILED" >&2
fi

exit $UNLOCK_RESULT


And we set the user and group of this file as root. Permission is 700.
When we restart MM, we can find that device always being locked.
But if we call this script with sudo, fcc lock would be unlocked right now. 
I also checked the log of MM, and it seems no FCC related logs would be
printed. Could you help me with some guidance and assistance?


At 2023-09-22 21:09:45, "Aleksander Morgado"  wrote:
>Hey
>
>> I have a concern about can we commit binary files into 
>> /data/dispatcher-fcc-unlock folder?
>
>All the FCC unlock scripts/programs shipped by ModemManager are
>GPLv2+. If you can distribute your program under the GPLv2+, we could
>set it up to build from source along with the ModemManager project.
>
>If you want to dump a proprietary precompiled binary in the fcc-unlock
>folder, the answer is "no" :)
>
>Cheers!
>
>-- 
>Aleksander


Re:Re: May I commit binary files into MM project?

2023-10-24 Thread Slark Xiao


At 2023-09-22 22:17:24, "Florian Eckert"  wrote:
>
>
>
>>> I have a concern about can we commit binary files into 
>>> /data/dispatcher-fcc-unlock folder?
>
>> If you want to dump a proprietary precompiled binary in the fcc-unlock
>> folder, the answer is "no" :)
>
>Regardless, these binaries would not run on other architectures!
Thanks for this notice.
>Therefore, they must be scripts or source code that can be compiled.
>The modem manager is used in OpenWrt and this distribution supports many 
>architectures.
>
>Best Regards
>
>Florian Eckert
And also thank you all for this clear answer. We'll consider it again.

Re: May I commit binary files into MM project?

2023-09-22 Thread Florian Eckert





I have a concern about can we commit binary files into 
/data/dispatcher-fcc-unlock folder?



If you want to dump a proprietary precompiled binary in the fcc-unlock
folder, the answer is "no" :)


Regardless, these binaries would not run on other architectures!
Therefore, they must be scripts or source code that can be compiled.
The modem manager is used in OpenWrt and this distribution supports many 
architectures.


Best Regards

Florian Eckert


Re: May I commit binary files into MM project?

2023-09-22 Thread Aleksander Morgado
Hey

> I have a concern about can we commit binary files into 
> /data/dispatcher-fcc-unlock folder?

All the FCC unlock scripts/programs shipped by ModemManager are
GPLv2+. If you can distribute your program under the GPLv2+, we could
set it up to build from source along with the ModemManager project.

If you want to dump a proprietary precompiled binary in the fcc-unlock
folder, the answer is "no" :)

Cheers!

-- 
Aleksander


May I commit binary files into MM project?

2023-09-22 Thread Slark Xiao
Hi all,
I have a concern about can we commit binary files into 
/data/dispatcher-fcc-unlock folder?
Then end user could call the script which will call this binary to do the 
unlock operation.

This binary file are only used for specific VID/PID products.
I saw project following GNU LGPLV2.1, but still want to do a double check.
Hope to get your reply soon.


Thanks.