Rndis windows 10 отваливается

Использовал для банковского терминала вот этот скрипт на powershell, добавлял в планировщик при включении компьютера. Wan и lan это имена сетевых интерфейсов

# Register the HNetCfg library (once)

#regsvr32 hnetcfg.dll

# Create a NetSharingManager object

$m = New-Object -ComObject HNetCfg.HNetShare

#Write-Host «1»

# List connections

#$m.EnumEveryConnection |% { $m.NetConnectionProps.Invoke($_) }

#Find connection

$cw = $m.EnumEveryConnection |? { $m.NetConnectionProps.Invoke($_).Name -eq «wan» }

$cl = $m.EnumEveryConnection |? { $m.NetConnectionProps.Invoke($_).Name -eq «lan» }

#Get sharing configuration

$configw = $m.INetSharingConfigurationForINetConnection.Invoke($cw)

$configl = $m.INetSharingConfigurationForINetConnection.Invoke($cl)

# See if sharing is enabled

#Write-Output $config.SharingEnabled

# See the role of connection in sharing

# 0 — public, 1 — private

# Only meaningful if SharingEnabled is True

#Write-Output $config.SharingType

#$config.DisableSharing()

#if ($configw.SharingEnabled -eq $true)

#{write-host «1»

$configw.DisableSharing()

$configl.DisableSharing()

$configw.EnableSharing(0)

$configl.EnableSharing(1)

#}

#else {write-host «0»

#$configw.EnableSharing(0)

#$configl.EnableSharing(1)

#}

# Disable sharing

#$configw.DisableSharing()

#$configl.DisableSharing()

#$configw.EnableSharing(0)

#$configl.EnableSharing(1)

#Write-Output $config.SharingEnabled

# Enable sharing (0 — public, 1 — private)

#$config.EnableSharing(0)

#Write-Output $config.SharingEnabled

#

Допустим есть онлайн касса, которая подключается по USB к компьютеру и работает в режиме RNDIS, т.е. должна подключаться к интернету через виртуальный сетевой адаптер. Для этого нужно или объединить адаптеры в бридж, или открыть общий доступ к подключению к интернету в свойствах основного подключения на компьютере. Первый способ после обновления 10-ки до версии 1803 работать перестал — при создании бриджа на компьютере пропадает интернет (если кто-то знает решение — прошу отписаться).

Рассмотрим второй способ. Заходим в свойства основного физического адаптера на компьютере, вкладка Доступ, ставим галочку «Разрешить другим пользователям сети …».

Затем нажимаем «Настройка», и добавляем службу, которая должна быть доступна на нашей онлайн-кассе например если к ней нужно обращаться с сервера. В нашем случае это порт 7778, внутренний IP кассы мы установили заранее через драйвер самой кассы — это адрес 192.168.137.111.

В свойствах виртуального сетевого адаптера нужно установить ip-адрес 192.168.137.1 (если он автоматически не установится при открытии общего доступа).

Прописываем всё это, закрываем — вроде всё работает, телнетом можем проверить подключение с сервера к кассе на порт 7778 через IP адрес компьютера:

telnet 192.168.215.158 7778

где 192.168.215.158 — ip компьютера в локальной сети.

Однако при перезагрузке общий доступ пропадает, и если зайти в сетевые подключения, на виртуальном адаптере видим «Неопознанная сеть». Помогает снятие и установка галочки доступа, которую мы ставили на первом шаге при настройке. Делать это вручную при каждой перезагрузке совсем неудобно, поэтому можно создать powershell скрипт для автоматического запуска.

Вот текст скрипта:

# Register the HNetCfg library (once)
regsvr32 hnetcfg.dll
$m = New-Object -ComObject HNetCfg.HNetShare
$m.EnumEveryConnection |% { $m.NetConnectionProps.Invoke($_) }
$c1 = $m.EnumEveryConnection |? { $m.NetConnectionProps.Invoke($_).Name -eq "Ethernet" }
$c2 = $m.EnumEveryConnection |? { $m.NetConnectionProps.Invoke($_).Name -eq "Ethernet 2" }
$config1 = $m.INetSharingConfigurationForINetConnection.Invoke($c1)
$config2 = $m.INetSharingConfigurationForINetConnection.Invoke($c2)
$config1.DisableSharing()
$config2.DisableSharing()
# argument: 0 - public, 1 - private
$config1.EnableSharing(0)
$config2.EnableSharing(1)

Здесь Ethernet — название основного физического адаптера, Ethernet 2 — виртуальный адаптер, который должен получить доступ в интернет через компьютер.

В последних строчках скрипта запрещается и снова разрешается общий доступ для обоих адаптеров. Если это сделать только для одного (основного), то у меня возникала ошибка 0x80040201. А в этом случае ошибки нет.

А тут я описал как этот скрипт можно запускать при включении компьютера.

Это костыль, однако вариантов решения проблем с созданием бриджа и пропаданием интернета я пока не нашёл.

Windows 10: RNDIS device gets randomly disconnected every few days

Discus and support RNDIS device gets randomly disconnected every few days in Windows 10 Drivers and Hardware to solve the problem; We have a custom USB Remote NDIS based network device using IPv6 communication. It works mostly very reliably on both Windows 10 and Windows 7 test…
Discussion in ‘Windows 10 Drivers and Hardware’ started by Petteri Aimonen, Feb 1, 2021.

  1. RNDIS device gets randomly disconnected every few days

    We have a custom USB Remote NDIS based network device using IPv6 communication. It works mostly very reliably on both Windows 10 and Windows 7 test machines. However, on some machines the network connection gets dropped after a couple of days of operation.

    Symptoms:

    • When the problem does occur, it is usually a couple of hours after USB disconnect & reconnect.
    • Rebooting device fixes it for a few minutes, but then the connection drops again.
    • Rebooting Windows fixes it for a couple of days.
    • Disabling USB Selective Suspend fixes the issue on some machines, but not on others.

    We have tried to debug this both using hardware USB analyzer, and using Windows ETW tracing.

    In both of them we see the same behavior:

    1. Traffic works fine

    2. Suddenly PC stops sending packets, but continues polling some status information

    3. PC puts bus into USB reset state and tries to recover, but apparently fails.

    Full logs are available in private if needed.

    My questions:

    • What state could be persisting between USB disconnect and reconnect in the RNDIS driver, causing it to fail again faster until Windows reboot?
    • PC is sending packet «74 00 F6 00 6B 00 6F 00 6F 00 64 00» to USB endpoint 0 continuously. Our device always NACKs this. I haven’t found any description of this packet in RNDIS documentation, does anyone know what it is? The UTF16 payload decodes to «t*kood».
    • We are collecting ETW trace with «logman update ndis -p {DD7A21E6-A651-46D4-B7C2-66543067B869} 0x88035f3 5 -ets»
      but it does not show anything useful about why Windows stops sending packets or why it resets the device. Is there some other trace GUID that can provide more details on that?

    :)

  2. Bluetooth adapter disconnects randomly. (NOT just devices.)

    First of all, let me list all my specs.

    ASUS ROG GL752VW

    Intel core i7 6700 @ 2.6GHz

    Windows 10×64

    16GB RAM

    Now my problem: my Bluetooth adapter seems to disconnect randomly and I have no idea why. Sometimes it will go months without ever disconnecting, and sometimes it disconnects and goes months without even working. The little icon disappears from my taskbar, and I am unable to use Bluetooth. My computer reports that I don’t have bluetooth. I am not sure of the exact adapter but I do know it is Intel and that they are together. I never ever have any issues with WiFi however Bluetooth is just causing me all sorts of hell.
    I’ve tried all of the following things, so please don’t suggest them…

    Rebooting. Tried it multiple times

    Reinstalling the drivers. With and without rebooting.

    Uninstalling the device from Device Manager and reinstalling it.

    «Repair»ing the driver from the installer.

    Can anyone help me?

  3. USB device randomly disconnecting

    I have a Yamaha MG10XU audio mixer and for the past 3 months the mixer will randomly disconnect and the device manager says «the drivers for this device are not installed (code28). Then I can turn the mixer off and on it will work for a little bit then
    disconnect again.

  4. RNDIS device gets randomly disconnected every few days

    RNDIS USB Modem Dongle is not working after installing Windows 10 Fall Creators Update

    Hi,

    Updated 1/31/18:

    A fix for this issue was included in the
    January 31, 2018 Windows Update (KB4058258). If you are experiencing this issue, please install the latest Windows Updates.

    If the issue continues after installing the update, you may need to uninstall and reinstall your Remote NDIS network adapter using Device Manager:

    • Open Device Manager. To do this, press and hold (or right-click) the Start Menu icon and select Device Manager.
    • Expand Network adapters and find an entry for the Remote NDIS based Internet Sharing Device.
    • Right click Remote NDIS based Internet Sharing Device and select
      Uninstall device.
    • Select Network adapters and then select Action and then
      Scan for hardware changes.

    Note:

    • Ensure that the RNDIS device is plugged in on the PC’s USB when performing these steps.
    • If the RNDIS device is moved to another USB port, these steps will need to be repeated.

    *******

    (Original post

    Microsoft is aware of reports of problems with RNDIS USB network adapters after installing the Windows 10 Fall Creators Update. We are working on the problem and hope to have a solution released in a future Windows Update.
    We will update this thread when the fix is released. Until then, these steps should help you recover your modem functionality:

    Notes:

    • KB4051963 (OS Build 16299.98) must be installed before performing these steps.
      • To confirm OS build, go to Start > Settings >
        System > About.
      • To install the update, go to Start > Settings >
        Update & security > Windows Update, click
        Check for updates
        , then install any available updates.
    • Ensure that the RNDIS device is plugged in on the PC’s USB when performing these steps.
    • If the RNDIS device is moved to another USB port, these steps will need to be repeated.

    Step 1: Open Device Manager. To do this, press and hold (or right-click) the Start Menu icon and select Device Manager.

    Step 2: Expand Network adapters and find an entry for the
    Remote NDIS based Internet Sharing Device.

    Step 3: Right click Remote NDIS based Internet Sharing Device and select
    Update Driver.

    Step 4: Select Browse my computer for driver software.

    Step 5: Select Let me pick from a list of available drivers for my computer.

    Step 6: Click Have Disk.

    Step 7: In the “Copy manufacturer’s files from:” field, enter c:\windows\inf
    and click OK.

    Step 8: Uncheck the box for “Show compatible Hardware”.

    Step 9: In the left pane, select Microsoft as the manufacturer, and in the right pane, select
    USB RNDIS Adapter as the model. Click Next.

    Step 10: You should now receive an “Update Driver Warning”. Select
    Yes to continue installing this driver.

    Step 11: Click Close.

    Regards.

Thema:

RNDIS device gets randomly disconnected every few days

  1. RNDIS device gets randomly disconnected every few days — Similar Threads — RNDIS device gets

  2. Wi-fi keeps getting disconnected randomly. Could be every few seconds or few minutes.

    in Windows 10 Gaming

    Wi-fi keeps getting disconnected randomly. Could be every few seconds or few minutes.: So I have had this issue with my pc for several months now and I have just been dealing with it. But basically my wi if connection will just disconnect for a few seconds at a time 1-10 and then reconnect. Sometimes it won’t happen for an hour, sometimes it will happen every…
  3. I get BSOD every few days.

    in Windows 10 Gaming

    I get BSOD every few days.: i9 12900K/RTX 3080/64GB DDR4Here are these dumps.https://www.dropbox.com/s/gt5mrzbxhje9cbb/minidump.zip?dl=0Hope someone help me find the reason.

    https://answers.microsoft.com/en-us/windows/forum/all/i-get-bsod-every-few-days/2fd7fa56-0609-48f4-8548-7f40081c270a

  4. I get BSOD every few days.

    in Windows 10 Software and Apps

    I get BSOD every few days.: i9 12900K/RTX 3080/64GB DDR4Here are these dumps.https://www.dropbox.com/s/gt5mrzbxhje9cbb/minidump.zip?dl=0Hope someone help me find the reason.

    https://answers.microsoft.com/en-us/windows/forum/all/i-get-bsod-every-few-days/2fd7fa56-0609-48f4-8548-7f40081c270a

  5. Random BSODs every few days

    in Windows 10 Software and Apps

    Random BSODs every few days: For the past few months I’ve been random BSODs for seemingly no reason, the computer isn’t being stressed or doing anything ‘unique’ at the time it happens, the BSOD errors include : 01/06/23 : PAGE_FAULT_IN_NONPAGED_AREA01/03/23 : Memory Management : WARNING: Unable to…
  6. Random BSODs every few days

    in Windows 10 BSOD Crashes and Debugging

    Random BSODs every few days: For the past few months I’ve been random BSODs for seemingly no reason, the computer isn’t being stressed or doing anything ‘unique’ at the time it happens, the BSOD errors include : 01/06/23 : PAGE_FAULT_IN_NONPAGED_AREA01/03/23 : Memory Management : WARNING: Unable to…
  7. Random BSODs every few days

    in Windows 10 Gaming

    Random BSODs every few days: For the past few months I’ve been random BSODs for seemingly no reason, the computer isn’t being stressed or doing anything ‘unique’ at the time it happens, the BSOD errors include : 01/06/23 : PAGE_FAULT_IN_NONPAGED_AREA01/03/23 : Memory Management : WARNING: Unable to…
  8. Devices randomly disconnecting every hour

    in Windows 10 Drivers and Hardware

    Devices randomly disconnecting every hour: Every hour or so all devices disconnect and I have to refresh the browser as well. For example I have my wireless headphones connected, wired controller connected and playing a game on screen 1 and watching youtube on screen 2. Every 1h-1h30 my controller and headphones…
  9. Getting BSODs Every Few Days

    in Windows 10 BSOD Crashes and Debugging

    Getting BSODs Every Few Days: Hi,

    For the past 6 months I have been getting the odd BSOD on Windows 10. I’ve updated all drivers I could think of and have run MemTest several times even overnight but my memory always passes with no errors.

    My hardware:

    CPU: Ryzen 3700X

    Motherboard: Gigabyte Aorus…

  10. BSOD every few hours or few days — very random

    in Windows 10 BSOD Crashes and Debugging

    BSOD every few hours or few days — very random: I added a new video card so I could add a new 4K Dell P2715Q monitor with my current Dell 2407 WFP. The card is a PNY nVidia quadro k620. When I added them I still had Windows 7. Started getting random BSOD with various reasons indicated such as «driver IRQL not less or…

Как удаленно из интернета управлять кассой Штрих-М с RnDIS адаптером?

Передачу чеков со Штрих-Online на ОФД опишем отдельно на соседней странице сайта.

Здесь настроим только управление по ip кассой Штрих.

Итак картинку в студию — как мы все это делаем :

Тут схематично показано как с другого ПК (192.168.1.2) в локальной сети управлять кассой 192.168.137.111 по порту 7778:

У нас наш ПК :
ОС Windows 10-64
касса Штрих-Online ФФД 1.05 с тестовым ФН 1.0
тестовый кабинет ОФД-Я (бесплатный)
роутер Keenetic Giga (отличная вещь)

1. Сетевая карта Ethernet to router (Сеть3) 192.168.1.50 / 255.255.255.0/ шлюз 192.168.1.1/ DNS 8.8.8.8 (за ним роутер, далее локалка или интернет).

1.1 на закладке ДОСТУП галочка на «Разрешить другим пользователям сети использовать подключение к интернету Данного компьютера» НЕ стоит.

2. RnDIS адаптер (появляется при подключении ККТ Штрих по USB) 192.168.137.1/ 255.255.255.0/ шлюз 192.168.137.111

3. Сама касса 192.168.137.111 / 255.255.255.0/ шлюза тут нет — т.к. касса само олицетворение интернета/ DNS 192.168.1.50

наш ipconfig такой :

Соединяем две сети (два сетевых адаптора),

Другими словами настраиваем маршрутизацию пакетов из одной сети в другую:

netsh interface portproxy add v4tov4 listenaddress=192.168.1.50 listenport=7778 connectaddress=192.168.137.111 connectport=7778

Разрешаем в брандмауре Windows входящие подключения по 7778.

Ну и итоге все нормально работает:

Соединяемся из локалки с ПК 192.168.1.2

Обратите внимание на 192.18.1.50 соединяемся , а далее он нас перекинет на 192.168.137.111 : 7778

Внимание : при этом сетевой мост не использовали от слова совсем.

Чтобы каждый раз netsh загружалась автоматом при старте ПК надо закинуть cmd файл (понятно с каким содержанием) в автозагрузку Windows:

Win + R , далее shell:startup

Далее в логах видим , что при такой настройке связи с ОФД нет совсем. То есть чеки мы бьем нормально, а связь с ОФД для полного комплекта еще надо настроить.

Но на этом здесь все , настройка связи с ОФД на соседней странице сайта.

Describe the problem
I tried to setup the USB network between my NRF52840DK board and my windows 10 computer, by enabling USB_DEVICE_NETWORK_RNDIS. However, Windows 10 has problem to talk with my device blocked by the following two issues:

  • Windows 10 can’t install a proper RNDIS network driver for my device automatically. I have to manually choose «Microsoft Remote NDIS Compatible Device» driver.

  • Windows can’t set its IP address on its host side manually, as shown below:

    image

To Reproduce
Steps to reproduce the behavior:
Enable NETWORKING and the following settings:

config USB_DEVICE_NETWORK_RNDIS
    default y
    select NET_IPV4
    select NET_TCP
    select NET_UDP
    select NET_SOCKETS
    select DNS_RESOLVER
    select SNTP
    select NET_CONFIG_SETTINGS
    select DNS_SERVER_IP_ADDRESSES
    select NET_SOCKETS_POSIX_NAMES
    select USB_DEVICE_OS_DESC

config NET_PKT_RX_COUNT
    default 4
config NET_PKT_TX_COUNT
    default 4
config NET_BUF_RX_COUNT
    default 12
config NET_BUF_TX_COUNT
    default 12
config DNS_SERVER1
    default "8.8.8.8"
config NET_CONFIG_MY_IPV4_ADDR
    default "192.168.33.111"
config NET_CONFIG_MY_IPV4_NETMASK
    default "255.255.255.0"
config NET_CONFIG_MY_IPV4_GW
    default "192.168.33.101"
config NET_CONFIG_PEER_IPV4_ADDR
    default "192.168.33.101"

Expected behavior
Window shall automatically recognize the USB RNDIS device and install the proper driver. And the host IP address on the USB network interface shall allow to be changed.

Impact
USB Network on Windows doesn’t work.

Screenshots or console output
If applicable, add a screenshot (drag-and-drop an image), or console logs
(cut-and-paste text and put a code fence («`) before and after, to help
explain the issue.

Environment (please complete the following information):

  • image

  • Zephyr v2.1

  • NRF52840 DK board

Additional Context
The same device works well with Linux (Ubuntu 18.01)

More logs are attached.
rndis_logs2.txt

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Сколько можно пользоваться неактивированной windows 10
  • Microsoft windows security spp 16385
  • Lenovo ideapad 320 drivers windows 10
  • Как узнать в каком режиме работает жесткий диск dma или pio windows 10
  • Не открывается окно активации windows