I try to connect to a 3G/4G/5G mobile network using the Telit 5G modem FN990, and I even see an IP address in the logs, however it is not getting assigned to network device wwan0.
the PIN of the SIM is removed, as documented in https://wiki.archlinux.org/title/Mobile_broadband_modem#Remove_the_PIN .
there's basically two routes I took, both of which fail.
a) using nmcli
host:~# nmcli con show
NAME UUID TYPE DEVICE
Wired connection 2 9f1bf5da-f9e9-3f30-9f49-e567adf1f1b7 ethernet eth1
Wired connection 1 67fdb9dc-d570-3d55-ad2b-68281b3ca03d ethernet --
host:~# nmcli connection add type gsm con-name conn5g ifname cdc-wdm0
Connection 'conn5g' (50c76297-5289-452f-a105-2525122cf9c0) successfully added.
host:~# nmcli con show
NAME UUID TYPE DEVICE
Wired connection 2 9f1bf5da-f9e9-3f30-9f49-e567adf1f1b7 ethernet eth1
Wired connection 1 67fdb9dc-d570-3d55-ad2b-68281b3ca03d ethernet --
conn5g 50c76297-5289-452f-a105-2525122cf9c0 gsm --
host:~#
host:~# nmcli con up conn5g
Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).
host:~#
b) using mmcli
host:~# mmcli -m 0 --simple-connect="apn=internet.telekom,user=telekom,password=telekom"
successfully connected the modem
host:~#
during that, /var/log/messages says:
Feb 20 08:45:09 host daemon.debug ModemManager[319]: <debug> [modem0] processing 3GPP info...
Feb 20 08:45:09 host daemon.debug ModemManager[319]: <debug> [modem0] 3GPP cell id updated: '2<XXX>9->2<XXX>1'
Feb 20 08:45:09 host daemon.debug ModemManager[319]: <debug> [modem0] 3GPP location updated (MCC: '262', MNC: '1', location area code: '0', tracking area code: '<XXX>', cell ID: '2<XXX>1')
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0] user request to connect modem
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0] simple connect started...
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0] PIN: unspecified
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0] operator ID: unspecified
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0] allowed roaming: yes
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0] APN: internet.telekom
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0] IP family: unspecified
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0] allowed authentication: unspecified
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0] User: telekom
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0] Password: telekom
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0] simple connect state (4/8): wait to get fully enabled
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0] simple connect state (5/8): register
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0] already registered automatically in network '26201', automatic registration not launched...
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0] simple connect state (6/8): bearer
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0] Using already existing bearer at '/org/freedesktop/ModemManager1/Bearer/1'...
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0] simple connect state (7/8): connect
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0/bearer1] connecting...
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0] state changed (registered -> connecting)
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0/bearer1] launching connection with QMI port (cdc-wdm0) and data port (wwan0)
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0/bearer1] no specific IP family requested, defaulting to ipv4
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0/bearer1] defaulting to use static IP method
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0/bearer1] running IPv4 connection setup
[...]
Feb 20 08:46:34 host daemon.debug ModemManager[319]: [/dev/cdc-wdm0] Received generic response (translated)... <<<<<< QMUX: <<<<<< length = 69 <<<<<< flags = 0x80 <<<<<< service = "wds" <<<<<< client = 16 <<<<<< QMI: <<<<<< flags = "response" <<<<<<
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0/bearer1] IP Family: IPv4
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0/bearer1] QMI IPv4 Settings:
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0/bearer1] address: 10.156.137.45/30
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0/bearer1] gateway: 10.156.137.46
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0/bearer1] DNS #1: 10.74.210.210
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0/bearer1] DNS #2: 10.74.210.211
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0/bearer1] MTU: 1500
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0/bearer1] domains:
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0/wwan0/net] port now connected
Feb 20 08:46:34 host daemon.debug ModemManager[319]: <debug> [modem0/bearer1] connected
Feb 20 08:46:34 host daemon.info ModemManager[319]: <info> [modem0] state changed (connecting -> connected)
to me this looks good, but wwan0 is down, and has no IP:
host:~# ip a s wwan0
6: wwan0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/none
the state of the modem at this time:
host:~# mmcli -m 0
-----------------------------------
General | path: /org/freedesktop/ModemManager1/Modem/0
| device id: 4<XXX>e
-----------------------------------
Hardware | manufacturer: Telit
| model: FN990A28
| firmware revision: M0R.000001-B003
| carrier config: default
| h/w revision: 1.00
| supported: gsm-umts, lte, 5gnr
| current: gsm-umts, lte, 5gnr
| equipment id: 359<XXX>7
-----------------------------------
System | device: /sys/devices/platform/soc#0/32f10108.usb/38200000.dwc3/xhci-hcd.1.auto/usb3/3-1
| drivers: option, qmi_wwan
| plugin: telit
| primary port: cdc-wdm0
| ports: cdc-wdm0 (qmi), ttyUSB2 (at), ttyUSB3 (at), ttyUSB4 (at),
| wwan0 (net)
-----------------------------------
Numbers | own: +49<XXX>
-----------------------------------
Status | lock: sim-pin2
| unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
| state: connected
| power state: on
| access tech: lte
| signal quality: 100% (cached)
-----------------------------------
Modes | supported: allowed: 3g; preferred: none
| allowed: 4g; preferred: none
| allowed: 3g, 4g; preferred: 4g
| allowed: 3g, 4g; preferred: 3g
| allowed: 5g; preferred: none
| allowed: 3g, 5g; preferred: 5g
| allowed: 3g, 5g; preferred: 3g
| allowed: 4g, 5g; preferred: 5g
| allowed: 4g, 5g; preferred: 4g
| allowed: 3g, 4g, 5g; preferred: 5g
| allowed: 3g, 4g, 5g; preferred: 4g
| allowed: 3g, 4g, 5g; preferred: 3g
| current: allowed: 3g, 4g, 5g; preferred: 5g
-----------------------------------
Bands | supported: utran-1, utran-4, utran-6, utran-5, utran-8, utran-2,
| eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8,
| eutran-12, eutran-13, eutran-14, eutran-17, eutran-18, eutran-19,
| eutran-20, eutran-25, eutran-26, eutran-28, eutran-29, eutran-30,
| eutran-32, eutran-34, eutran-38, eutran-39, eutran-40, eutran-41,
| eutran-42, eutran-43, eutran-46, eutran-48, eutran-66, eutran-71,
| utran-19
| current: utran-1, utran-4, utran-6, utran-5, utran-8, utran-2,
| eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8,
| eutran-12, eutran-13, eutran-14, eutran-17, eutran-18, eutran-19,
| eutran-20, eutran-25, eutran-26, eutran-28, eutran-29, eutran-30,
| eutran-32, eutran-34, eutran-38, eutran-39, eutran-40, eutran-41,
| eutran-42, eutran-43, eutran-46, eutran-48, eutran-66, eutran-71,
| utran-19
-----------------------------------
IP | supported: ipv4, ipv6, ipv4v6
-----------------------------------
3GPP | imei: 359<XXX>7
| enabled locks: fixed-dialing
| operator id: 26201
| operator name: Telekom.de
| registration: home
-----------------------------------
3GPP EPS | ue mode of operation: csps-2
| initial bearer path: /org/freedesktop/ModemManager1/Bearer/0
| initial bearer apn: internet.telekom
| initial bearer ip type: ipv4
-----------------------------------
SIM | primary sim path: /org/freedesktop/ModemManager1/SIM/0
| sim slot paths: slot 1: /org/freedesktop/ModemManager1/SIM/0 (active)
| slot 2: none
-----------------------------------
Bearer | paths: /org/freedesktop/ModemManager1/Bearer/1
host:~#
here's some info about the tool versions:
host:~# nmcli --version
nmcli tool, version 1.30.4
host:~# mmcli --version
mmcli 1.16.2
Copyright (2011 - 2021) Aleksander Morgado
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
host:~#
here's some info about the kernel:
host:~# zcat /proc/config.gz | grep CDC
CONFIG_USB_NET_CDCETHER=y
# CONFIG_USB_NET_CDC_EEM is not set
CONFIG_USB_NET_CDC_NCM=y
# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set
CONFIG_USB_NET_CDC_MBIM=y
# CONFIG_USB_NET_CDC_SUBSET is not set
CONFIG_BRCMFMAC_PROTO_BCDC=y
# CONFIG_MFD_ATMEL_HLCDC is not set
CONFIG_USB_CDC_COMPOSITE=m
CONFIG_USB_G_MULTI_CDC=y
# CONFIG_COMMON_CLK_CDCE706 is not set
# CONFIG_COMMON_CLK_CDCE925 is not set
host:~#
host:~# zcat /proc/config.gz | grep WWAN
CONFIG_USB_NET_QMI_WWAN=y
CONFIG_USB_SERIAL_WWAN=y
host:~#
can anyone point me to what's going wrong, or how I can further debug the issue? Why is wwan0 not assigned the IP despite the line [modem0/wwan0/net] port now connected?
I am using an orange pi to connect to BLE devices, and I would like to use the on board ble interface, I am using OPI3 LTS OS: Orange Pi Focal with Linux 5.10.75-sunxi64
when I run sudo hciconfig -a I can see devices available:
hci1: Type: Primary Bus: UART
BD Address: 10:11:12:13:14:15 ACL MTU: 1021:8 SCO MTU: 240:3
UP RUNNING PSCAN
RX bytes:213806 acl:0 sco:0 events:12843 errors:0
TX bytes:689392 acl:0 sco:0 commands:12843 errors:0
Features: 0xbf 0xff 0x8d 0xfe 0xdb 0x3d 0x7b 0xc7
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'orangepi3-lts'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Version: 5.0 (0x9) Revision: 0x400
LMP Version: 5.0 (0x9) Subversion: 0x400
Manufacturer: Spreadtrum Communications Shanghai Ltd (492)
hci0: Type: Primary Bus: USB
BD Address: 00:1A:7D:DA:71:13 ACL MTU: 310:10 SCO MTU: 64:8
DOWN
RX bytes:184866998 acl:8964 sco:0 events:5069260 errors:0
TX bytes:1669130 acl:9985 sco:0 commands:96182 errors:16
Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
The on board ble interface is hci1, so I shutdown my dongle hci0 and when I try doing a scan using bluetoothctl, I get this error Failed to start discovery: org.bluez.Error.NotReady
I can use the hci0 to do scan though and connect to devices when I bring it up and running, but not on board hci1.
I used the mutex to synchronize the two kernel threads. After running, panic occurred in the system and abnormal memory was found in mutex by kdump.
Here is a simplified code example, You can run it directly to reproduce the problem.
I changed the memory allocation method to use kmalloc instead of vmalloc, and then it worked, Who knows why?
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/kthread.h>
#include <linux/slab.h>
struct product {
struct list_head list;
struct mutex lock;
bool finish;
};
struct task_struct *task1;
struct task_struct *task2;
spinlock_t spin;
struct list_head products;
struct product *create_product(void)
{
struct product *p_prod;
p_prod = vmalloc(sizeof(struct product));
// p_prod = kmalloc(sizeof(struct product), GFP_KERNEL);
if(!p_prod)
return NULL;
INIT_LIST_HEAD(&p_prod->list);
mutex_init(&p_prod->lock);
p_prod->finish = false;
return p_prod;
}
void remove_product(struct product **pp_prod)
{
vfree(*pp_prod);
// kfree(*pp_prod);
*pp_prod = NULL;
}
int producer(void *data)
{
while(!kthread_should_stop())
{
struct product *p_prod = create_product();
if(!p_prod)
continue;
spin_lock(&spin);
list_add_tail(&p_prod->list, &products);
spin_unlock(&spin);
while (true)
{
mutex_lock(&p_prod->lock);
if(p_prod->finish)
{
mutex_unlock(&p_prod->lock);
schedule();
break;
}
mutex_unlock(&p_prod->lock);
}
remove_product(&p_prod);
}
do_exit(0);
}
int consumer(void *data)
{
while(!kthread_should_stop())
{
struct product *p_prod;
spin_lock(&spin);
if(list_empty(&products))
{
spin_unlock(&spin);
schedule();
continue;
}
p_prod = list_first_entry(&products, struct product, list);
list_del(&p_prod->list);
spin_unlock(&spin);
mutex_lock(&p_prod->lock);
p_prod->finish = true;
mutex_unlock(&p_prod->lock);
}
do_exit(0);
}
static int __init kdemo_init(void) {
printk(">>> demo driver begin!\n");
spin_lock_init(&spin);
INIT_LIST_HEAD(&products);
task1 = kthread_run(producer, NULL, "hdz-producer");
task2 = kthread_run(consumer, NULL, "hdz-consumer");
return 0;
}
static void __exit kdemo_exit(void) {
kthread_stop(task1);
kthread_stop(task2);
printk(">>> demo driver exit!\n");
}
module_init(kdemo_init);
module_exit(kdemo_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("xxxx#xxx.com");
MODULE_VERSION("1.0");
dmesg log and consumer stack
[ 176.599116] >>> demo driver begin!
[ 177.167659] BUG: unable to handle kernel NULL pointer dereference at 0000000000000fb0
[ 177.167695] IP: [<ffffffff9e0caa47>] wake_q_add+0x17/0x50
[ 177.167719] PGD 0
[ 177.167729] Oops: 0002 [#1] SMP
[ 177.167743] Modules linked in: kdemo(OE) mpt3sas mptctl mptbase nvmet_rdma nvmet nvme_rdma nvme_fabrics nvme nvme_core drbd(OE) dell_rbu kvdo(OE) uds(OE) bonding sha512_ssse3 sha512_generic qat_api(OE) usdm_drv(OE) intel_qat(OE) authenc uio ib_isert iscsi_target_mod ib_srpt target_core_mod ib_srp scsi_transport_srp scsi_tgt ib_ucm rpcrdma sunrpc rdma_ucm ib_umad ib_uverbs ib_iser rdma_cm ib_ipoib iw_cm libiscsi scsi_transport_iscsi ib_cm mlx5_ib ib_core intelcas(OE) inteldisk(OE) iTCO_wdt iTCO_vendor_support dell_smbios sparse_keymap dcdbas skx_edac intel_powerclamp coretemp intel_rapl iosf_mbi kvm irqbypass crc32_pclmul ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper cryptd sg joydev pcspkr ipmi_si i2c_i801 lpc_ich shpchp ipmi_devintf ipmi_msghandler mei_me acpi_power_meter
[ 177.168071] mei acpi_pad wmi nfit libnvdimm dm_multipath binfmt_misc ip_tables xfs libcrc32c mgag200 drm_kms_helper crc32c_intel syscopyarea sysfillrect sysimgblt mlx5_core fb_sys_fops ttm ixgbe drm igb mlxfw devlink mdio ptp i2c_algo_bit pps_core i2c_core dca sr_mod cdrom sd_mod crc_t10dif crct10dif_generic crct10dif_pclmul crct10dif_common ahci libahci libata mpt2sas raid_class scsi_transport_sas megaraid_sas dm_mirror dm_region_hash dm_log dm_mod
[ 177.168263] CPU: 24 PID: 5412 Comm: hdz-consumer Kdump: loaded Tainted: G OE ------------ 3.10.0-862.el7.x86_64 #1
[ 177.168297] Hardware name: Dell Inc. PowerEdge R740/08D89F, BIOS 2.10.2 02/24/2021
[ 177.168320] task: ffff93db22af3f40 ti: ffff93dc89354000 task.ti: ffff93dc89354000
[ 177.168344] RIP: 0010:[<ffffffff9e0caa47>] [<ffffffff9e0caa47>] wake_q_add+0x17/0x50
[ 177.168372] RSP: 0018:ffff93dc89357e48 EFLAGS: 00010246
[ 177.168389] RAX: 0000000000000000 RBX: ffffbe2ce6533018 RCX: 0000000000000fb0
[ 177.168410] RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff93dc89357e58
[ 177.168432] RBP: ffff93dc89357e48 R08: ffffbe2ce6533000 R09: 0000000000000000
[ 177.168453] R10: 0000000000000001 R11: 0000000000000001 R12: ffffbe2ce6533014
[ 177.168475] R13: ffff93dc89357e58 R14: 0000000000000000 R15: 0000000000000000
[ 177.168497] FS: 0000000000000000(0000) GS:ffff93dca9400000(0000) knlGS:0000000000000000
[ 177.168540] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 177.168560] CR2: 0000000000000fb0 CR3: 00000002b7a0e000 CR4: 00000000007607e0
[ 177.168583] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 177.168606] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 177.168629] PKRU: 00000000
[ 177.168640] Call Trace:
[ 177.168656] [<ffffffff9e711b2e>] __mutex_unlock_slowpath+0x5e/0x90
[ 177.168679] [<ffffffff9e710fab>] mutex_unlock+0x1b/0x20
[ 177.168699] [<ffffffffc0637064>] consumer+0x64/0x90 [kdemo]
[ 177.168723] [<ffffffffc0637000>] ? 0xffffffffc0636fff
[ 177.168746] [<ffffffff9e0bae31>] kthread+0xd1/0xe0
[ 177.168765] [<ffffffff9e0bad60>] ? insert_kthread_work+0x40/0x40
[ 177.168788] [<ffffffff9e71f61d>] ret_from_fork_nospec_begin+0x7/0x21
[ 177.168811] [<ffffffff9e0bad60>] ? insert_kthread_work+0x40/0x40
[ 177.168831] Code: 09 00 00 31 c9 31 d2 e8 18 41 ff ff eb e4 66 0f 1f 44 00 00 0f 1f 44 00 00 55 48 8d 8e b0 0f 00 00 31 c0 ba 01 00 00 00 48 89 e5 <f0> 48 0f b1 96 b0 0f 00 00 48 85 c0 74 0b 5d c3 66 0f 1f 84 00
[ 177.168996] RIP [<ffffffff9e0caa47>] wake_q_add+0x17/0x50
[ 177.169017] RSP <ffff93dc89357e48>
[ 177.169959] CR2: 0000000000000fb0
producer stask
crash> bt 5411
PID: 5411 TASK: ffff93db22af4f10 CPU: 1 COMMAND: "hdz-producer"
bt: page excluded: kernel virtual address: ffffffffffffffff type: "cpu_online_map"
#0 [ffff93dca8e48e48] crash_nmi_callback at ffffffff9e0533b7
#1 [ffff93dca8e48e58] nmi_handle at ffffffff9e71790c
#2 [ffff93dca8e48eb0] do_nmi at ffffffff9e717b2d
#3 [ffff93dca8e48ef0] end_repeat_nmi at ffffffff9e716d79
#4 [ffff93dca8e48f28] __vmalloc_node_range at ffffffff9e1d7518
[exception RIP: mutex_unlock+20]
RIP: ffffffff9e710fa4 RSP: ffff93ddafd73e98 RFLAGS: 00000202
RAX: 0000000000000010 RBX: 0000000000000010 RCX: 0000000000000202
RDX: ffff93ddafd73e98 RSI: 0000000000000018 RDI: 0000000000000001
RBP: ffffffff9e710fa4 R8: ffffffff9e710fa4 R9: 0000000000000018
R10: ffff93ddafd73e98 R11: 0000000000000202 R12: ffffffffffffffff
R13: ffffbe2ce6535010 R14: ffffffffc0639240 R15: 0000000000000000
ORIG_RAX: ffffffffc0639240 CS: 0010 SS: 0018
--- <(unknown) exception stack> ---
#5 [ffff93ddafd73e98] mutex_unlock at ffffffff9e710fa4
#6 [ffff93ddafd73ea0] producer at ffffffffc0637145 [kdemo]
#7 [ffff93ddafd73ec8] kthread at ffffffff9e0bae31
#8 [ffff93ddafd73f50] ret_from_fork_nospec_begin at ffffffff9e71f61d
I created small c code to disable Ethernet card device driver's poll interrupt handler on device settings. But its not causing my ethernet card to stop receiving packets. Why is that?
This is the code
#include <sys/io.h>
#include <linux/if_ether.h>
#include <net/ethernet.h>
#include <stdio.h>
#include <malloc.h>
#include <netinet/tcp.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
void main(){
unsigned long addr;
void *data=0x00;//malloc(sizeof(struct ether_header)+sizeof(struct iphdr)+sizeof(struct tcphdr));
addr=0x00000000fe400000+0x000C8;
int x=iopl(3);
outsb(addr,&data,sizeof(data));
}
Base addres that I am using in code 0x00000000fe400000
I check clearing interrupt at ofset 0x000C0 and 0x000C8
Other options are:
0x000C0=Interrupt Cause Read Register
0x000C4=Interrupt Throttling Register
0x000C8=Interrupt Cause Set Register
0x000D0=Interrupt Mask Set/Read Register
0x000D8=Interrupt Mask Clear Register
0x000E0=Interrupt Acknowledge Auto
Device Specification: Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection
(Lewisville) (rev 04)
DeviceName: Onboard LAN
lspci -vvv
Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (Lewisville) (rev 04)
DeviceName: Onboard LAN
Subsystem: Hewlett-Packard Company 82579LM Gigabit Network Connection >(Lewisville)
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 29
Region 0: Memory at fe400000 (32-bit, non-prefetchable) [size=128K]
Region 1: Memory at fe427000 (32-bit, non-prefetchable) [size=4K]
Region 2: I/O ports at f060 [size=32]
Capabilities: [c8] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee08004 Data: 4023
Capabilities: [e0] PCI Advanced Features
AFCap: TP+ FLR+
AFCtrl: FLR-
AFStatus: TP-
Kernel driver in use: e1000e
Kernel modules: e1000e
I use the following code to receive data from an ANT+ dongle I used other software (Zwift, which shows that the dongle actually received data) (Using OS X):
/* Require the config */
require('dotenv').config()
/* require the usb class */
var usb = require('usb');
/* find the device */
var device = usb.findByIds(process.env.VENDOR_ID, process.env.PRODUCT_ID);
/* open the device */
device.open(true);
/* claim interface WHERE IS THIS FOR */
const [interface] = device.interfaces;
interface.claim();
/* Start Polling */
const [inEndpoint, outEndpoint] = interface.endpoints;
inEndpoint.startPoll();
// inEndpoint.transferType = 2;
inEndpoint.on('data', (d) => {
console.log("usb data:", d, " len:", d.length)
});
inEndpoint.on('error', function (error) {
console.log("on error", error);
});
Do I do something wrong?
Underneath you find some loggin, I think I do everything right but it has to do something with node.
[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------
[ 0.003821] [00000307] libusb: debug [libusb_get_device_list]
[ 0.003925] [00000307] libusb: debug [libusb_get_device_descriptor]
[ 0.004005] [00000307] libusb: debug [libusb_get_device_descriptor]
[ 0.004021] [00000307] libusb: debug [libusb_get_device_descriptor]
[ 0.004033] [00000307] libusb: debug [libusb_get_device_descriptor]
[ 0.004125] [00000307] libusb: debug [libusb_open] open 20.9
[ 0.004269] [00000307] libusb: debug [usbi_add_pollfd] add fd 26 events 1
[ 0.004275] [00000307] libusb: debug [darwin_open] device open for access
[ 0.004301] [00004903] libusb: debug [handle_events] poll() returned 1
[ 0.004306] [00004903] libusb: debug [handle_events] caught a fish on the control pipe
[ 0.004319] [00004903] libusb: debug [libusb_get_next_timeout] no URBs, no timeout!
[ 0.004322] [00004903] libusb: debug [libusb_try_lock_events] someone else is modifying poll fds
[ 0.004324] [00004903] libusb: debug [libusb_event_handler_active] someone else is modifying poll fds
[ 0.004327] [00004903] libusb: debug [libusb_handle_events_timeout_completed] another thread is doing event handling
[ 0.004368] [00004903] libusb: debug [libusb_get_next_timeout] no URBs, no timeout!
[ 0.004380] [00004903] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.004384] [00004903] libusb: debug [handle_events] poll fds modified, reallocating
[ 0.004389] [00004903] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 0.004736] [00000307] libusb: debug [libusb_claim_interface] interface 0
[ 0.005084] [00000307] libusb: debug [get_endpoints] building table of endpoints.
[ 0.005100] [00000307] libusb: debug [get_endpoints] interface: 0 pipe 1: dir: 1 number: 1
[ 0.005107] [00000307] libusb: debug [get_endpoints] interface: 0 pipe 2: dir: 0 number: 1
[ 0.005133] [00000307] libusb: debug [darwin_claim_interface] interface opened
[ 0.005445] [00000307] libusb: debug [ep_to_pipeRef] converting ep address 0x81 to pipeRef and interface
[ 0.005454] [00000307] libusb: debug [ep_to_pipeRef] pipe 1 on interface 0 matches
[ 0.005540] [00000307] libusb: debug [ep_to_pipeRef] converting ep address 0x81 to pipeRef and interface
[ 0.005547] [00000307] libusb: debug [ep_to_pipeRef] pipe 1 on interface 0 matches
[ 0.005572] [00000307] libusb: debug [ep_to_pipeRef] converting ep address 0x81 to pipeRef and interface
[ 0.005576] [00000307] libusb: debug [ep_to_pipeRef] pipe 1 on interface 0 matches
[60.006611] [00004903] libusb: debug [handle_events] poll() returned 0
[60.006708] [00004903] libusb: debug [libusb_get_next_timeout] no URB with timeout or all handled by OS; no timeout!
[60.006727] [00004903] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[60.006742] [00004903] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[120.011876] [00004903] libusb: debug [handle_events] poll() returned 0
[120.011973] [00004903] libusb: debug [libusb_get_next_timeout] no URB with timeout or all handled by OS; no timeout!
[120.011994] [00004903] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[120.012007] [00004903] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[180.012077] [00004903] libusb: debug [handle_events] poll() returned 0
[180.012106] [00004903] libusb: debug [libusb_get_next_timeout] no URB with timeout or all handled by OS; no timeout!
[180.012112] [00004903] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[180.012116] [00004903] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms