Acesso da porta serial Putty ao console RS-232 mostrando o display de caracteres duplos com cabo USB / serial

0

Estou tentando acessar um console de administração de firewall do Matrix Sense por meio de sua interface RS-232 e a exibição que recebo com o Putty é estranha. O hardware é uma placa-mãe PC Engines APU4B4 .

Estou usando um conversor USB para RS-232 barato na minha máquina com Windows 7. O dispositivo foi reconhecido na porta COM4 sem necessidade de instalação de driver do meu lado.

Então, com estes parâmetros:

  • Velocidade 115200 bauds
  • 8 bits de dados
  • 1 Parar Bit
  • Paridade nenhuma
  • Controle de fluxo XON / XOFF

Eutambémajusteialgunsparâmetrosparaencontrarumaexibiçãomelhor:

  • Deslocamentodeecolocal
  • EdiçãodelinhalocalForçaem

Masissonãoparecefazermuito.

Eventualmenteeureceboestedisplayestranho:

Alguns caracteres são exibidos duas vezes e outros parecem aleatórios. Parece que estou perto de uma solução, mas não consigo descobrir o que há de errado aqui.

    
por Glassfrog 15.09.2018 / 06:05

2 respostas

1

Eu não tenho experiência com esse tipo de hardware, mas eu encontrei este tópico descrevendo sintomas semelhantes na APU1D.

Resposta:

You have enabled both iPXE's own serial console support (CONSOLE_SERIAL in config/console.h) and also your BIOS's serial console redirection.

Correção incorreta:

I did not realize that the PCBIOS console was enabled, because the option was commented out in config/console.h.

Undefining CONSOLE_PCBIOS in config/console.h solved my problem.

Explicação do motivo:

CONSOLE_PCBIOS is the "normal" console which writes to the screen and reads from the keyboard.

CONSOLE_SERIAL is iPXE's own serial port driver.

BIOS serial redirection is a feature implemented by your BIOS (and configurable via your BIOS setup screen) in which characters written to the screen will also be sent to the serial port.

The problem is that you have both CONSOLE_SERIAL and BIOS serial redirection enabled. iPXE writes each character both to the screen (due to CONSOLE_PCBIOS) and to the serial port (due to CONSOLE_SERIAL). Your BIOS then writes an additional copy of the character to the serial port, since you have BIOS serial redirection enabled. You therefore end up with two copies of each character on the serial port: one written directly by iPXE, one written by your BIOS.

The solution is to either disable CONSOLE_SERIAL or to disable your BIOS serial redirection (via your BIOS setup screen). Do not disable CONSOLE_BIOS

(provavelmente significa CONSOLE_PCBIOS )

… unless you really don't want to be able to interact via a local keyboard and monitor.

You may find that iPXE's CONSOLE_SERIAL is more robust than your BIOS's serial redirection feature, and so it might be preferable to leave CONSOLE_SERIAL enabled and disable the BIOS serial redirection (via your BIOS setup screen).

Feedback do remetente:

At least in the case of this alix board the serial driver of iPXE is indeed the preferable variant (haven't tried other serial devices yet), as the menu isn't displayed properly using the BIOS's redirection feature.

Unfortunately these devices are shipped with a very limited BIOS, in fact only the boot settings can be altered.

Nevertheless, I found a solution I'm happy with. I modified the file config/defaults/pcbios.h by changing the line defining the CONSOLE_PCBIOS option to:

  #define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_TUI )

This way at least the menu is printed only once in my serial setup and the iPXE output seems also to be fine in normal cases (non serial).

Mesmo que o seu caso seja um pouco diferente, acho que a causa raiz é semelhante: dois softwares enviam caracteres para a porta serial, um deles é o BIOS. Encontre uma maneira de silenciar um ou outro.

    
por 15.09.2018 / 06:57
0

Consegui ver corretamente o console após a reinicialização do firewall e a reinicialização da minha máquina. Eu comecei primeiro Putty e depois lancei o meu firewall.

Aqui estão os registros (censurei alguns pontos críticos). Mas você pode ver que algumas partes dos logs ainda têm o "problema de caractere duplo". O segundo ponto, ou seja, os "personagens de lixo" se foram.

Obrigado @Kamil Maciorowski pela sua preciosa ajuda.

FreeBSD/amd64 (pfSense.localdomain) (ttyu0)

pfSense - Serial: ▒▒▒▒▒▒▒▒▒▒ - Netgate Device ID: ********************

*** Welcome to pfSense 2.4.3-RELEASE-p1 (amd64) on pfSense ***

 WAN (wan)       -> igb2       ->
 LAN (lan)       -> igb3       -> v4: 176.16.0.1/12
 OPT1 (opt1)     -> igb0       ->
 OPT2 (opt2)     -> igb1       ->
 ****** (opt3)   -> ovpnc1     ->

 0) Logout (SSH only)                  9) pfTop
 1) Assign Interfaces                 10) Filter Logs
 2) Set interface(s) IP address       11) Restart webConfigurator
 3) Reset webConfigurator password    12) PHP shell + pfSense tools
 4) Reset to factory defaults         13) Update from console
 5) Reboot system                     14) Disable Secure Shell (sshd)
 6) Halt system                       15) Restore recent configuration
 7) Ping host                         16) Restart PHP-FPM
 8) Shell

Enter an option: 4


You are about to reset the firewall to factory defaults.
The firewall will reboot afteruresetting the configuration.
All additional packages installed will be removed.
Booting from Hard Disk...|n]? y
H
F1  pfSenserebooting now.
Sep 15 06:33:20 ipsec_starter[38232]: charon stopped after 200 ms
F6 PXE 06:33:20 ipsec_starter[38232]: ipsec starter stopped
Boot:  F1 ax 60 seconds) for system process 'vnlru' to stop... done
//bboooott//ccoonnffiigg::  --SS111155220000  --Daemon' to stop... done
Daiting (max 60 seconds) for system process 'syncer' to stop...
//ncing disks, vnodes remaining... 0 0 done
All buffers synced.
 Coonnssoolleess::  iinntteerrnnaall  vviiddeeoo//kkeeyybbooaarrdd    sseerriia
uhub2: detached
 BIIOOSS  ddrriivvee  CC::  iiss  ddiisskk00
coreboot build 20171130
 BIIOOSS  663399kkBB//33440066445566kkBB  aavvaaiillaabbllee  mmeemmoorryy
4080 MB ECC DRAM

SeaBIOS (version rel-1.11.0.1-0-g90da88d)
 FrreeeeBBSSDD//xx8866  bboooottssttrraapp  llooaaddeerr,,  RReevviissiioonn  1
Press F10 key now for boot menn
 (MMoonn  MMaarr  1199  0066::5566::3311  CCDDTT  22001188  rroooott@@bbuuiilld

 Looaaddiinngg  //bboooott//ddeeffaauullttss//llooaaddeerr..ccoonnff

 |
 H                  ____
 H    __  ____    //  __||______    ______  __  ____    ______    ______
 H  ||  ''__  \||  ||__//  ____||//  __  \  ''__  \//  ____||//  __  \
 H  ||  ||__))  ||    __\____  \    ____//  ||  ||  \____  \    ____//
 H  ||  ..____/___//\______||__||  ||__||______//\______||
 H  ||__||
 H
                                             H
 H++=======================================H++==================================
 H||          HWWeellccoommee  ttoo  ppffSSeennssee
 H||                                       H||||
 H||HH..BBoooott  MMuullttii  UUsseerr  [[EEnntteerr]]                         |
 H||HH..BBoooott  [[SS]]iinnggllee  UUsseerr||||            __________________ |
 H||HH..[[EEsscc]]aappee  ttoo  llooaaddeerr  pprroommpptt''  ________      // |
 H||HH..RReebboooott                       H||||      //    //         //      |
 H||                                       H||||    //    //______//    //     |
 H||HOOppttiioonnss::                      H||||  //      ____________//       |
 H||HH..[[KK]]eerrnneell::  kkeerrnneell  ((11  ooff  22))                    /|
 H||HH..CCoonnffiigguurree  BBoooott  [[OO]]ppttiioonnss......              //_|
 H||                                       H||      //                         |
 H||                                       H||    //______________________    _
 H++=======================================H++==================================


// HAAuuttoobboooott  iinn  22  sseeccoonnddss..  [[SSppaaccee]]  ttoo  ppaauuse
   HAAuuttoobboooott  iinn  11  sseeccoonnddss..  [[SSppaaccee]]  ttoo  ppaauuse
   H

//bboooott//kkeerrnneell//kkeerrnn ddaattaa==00xxbb66ffaa ssyymmss==[[00xx8 ++08
 ++00xx1 ]] affeedd

 Boooottiinngg......

KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.1-RELEASE-p10 #13 r313908+293707af843(RELENG_2_4): Thu May 10 15:09:8
    [email protected]:/builder/ce-243/tmp/obj/builder/ce-243/tmp/FreeB4
FreeBSD clang version 5.0.1 (tags/RELEASE_501/final 320880) (based on LLVM 5.0.)
VT(vga): resolution 640x480
CPU: AMD GX-412TC SOC                                (998.15-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0x******  Family=0x16  Model=0x30  Stepping=1
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,>
  Features2=0x3ed8220b<SSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT>
  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
  AMD Features2=0x1d4037ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW>
  Structured Extended Features=0x8<BMI1>
  XSAVE Features=0x1<XSAVEOPT>
  SVM: NP,NRIP,AFlush,DAssist,NAsids=8
  TSC: P-state invariant, performance statistics
real memory  = 5083496448 (4848 MB)
avail memory = 4073701376 (3884 MB)
Event timer "LAPIC" quality 100
ACPI APIC Table: <CORE   COREBOOT>
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s)
ioapic1: Changing APIC ID to 5
ioapic0 <Version 2.1> irqs 0-23 on motherboard
ioapic1 <Version 2.1> irqs 24-55 on motherboard
SMP: AP CPU #1 Launched!
SMP: AP CPU #3 Launched!
SMP: AP CPU #2 Launched!
Timecounter "TSC" frequency 998149043 Hz quality 1000
iwi_monitor: You need to read the LICENSE file in /usr/share/doc/legal/intel_iw.
iwi_monitor: If you agree with the license, set legal.intel_iwi.license_ack=1 i.
module_register_init: MOD_LOAD (iwi_monitor_fw, 0xffffffff80682e00, 0) error 1
random: entropy device external interface
wlan: mac acl policy registered
ipw_bss: You need to read the LICENSE file in /usr/share/doc/legal/intel_ipw.LI.
ipw_bss: If you agree with the license, set legal.intel_ipw.license_ack=1 in /b.
module_register_init: MOD_LOAD (ipw_bss_fw, 0xffffffff8065c140, 0) error 1
ipw_ibss: You need to read the LICENSE file in /usr/share/doc/legal/intel_ipw.L.
ipw_ibss: If you agree with the license, set legal.intel_ipw.license_ack=1 in /.
module_register_init: MOD_LOAD (ipw_ibss_fw, 0xffffffff8065c1f0, 0) error 1
ipw_monitor: You need to read the LICENSE file in /usr/share/doc/legal/intel_ip.
ipw_monitor: If you agree with the license, set legal.intel_ipw.license_ack=1 i.
module_register_init: MOD_LOAD (ipw_monitor_fw, 0xffffffff8065c2a0, 0) error 1
iwi_bss: You need to read the LICENSE file in /usr/share/doc/legal/intel_iwi.LI.
iwi_bss: If you agree with the license, set legal.intel_iwi.license_ack=1 in /b.
module_register_init: MOD_LOAD (iwi_bss_fw, 0xffffffff80682ca0, 0) error 1
iwi_ibss: You need to read the LICENSE file in /usr/share/doc/legal/intel_iwi.L.
iwi_ibss: If you agree with the license, set legal.intel_iwi.license_ack=1 in /.
module_register_init: MOD_LOAD (iwi_ibss_fw, 0xffffffff80682d50, 0) error 1
kbd0 at kbdmux0
netmap: loaded module
module_register_init: MOD_LOAD (vesa, 0xffffffff81162ce0, 0) error 19
nexus0
vtvga0: <VT VGA driver> on motherboard
cryptosoft0: <software crypto> on motherboard
padlock0: No ACE support.
acpi0: <CORE COREBOOT> on motherboard
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
cpu2: <ACPI CPU> on acpi0
cpu3: <ACPI CPU> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
Timecounter "ACPI-safe" frequency 3579545 Hz quality 850
acpi_timer0: <32-bit timer at 3.579545MHz> port 0x818-0x81b on acpi0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> irq 24 at device 2.1 on pci0
pcib1: failed to allocate initial I/O port window: 0x1000-0x1fff
pci1: <ACPI PCI bus> on pcib1
igb0: <Intel(R) PRO/1000 Network Connection, Version - 2.5.3-k> mem 0xf7900000-1
igb0: Using MSIX interrupts with 3 vectors
igb0: Ethernet address: **:**:**:**:**:**
igb0: Bound queue 0 to cpu 0
igb0: Bound queue 1 to cpu 1
igb0: netmap queues/slots: TX 2/1024, RX 2/1024
pcib2: <ACPI PCI-PCI bridge> irq 25 at device 2.2 on pci0
pci2: <ACPI PCI bus> on pcib2
igb1: <Intel(R) PRO/1000 Network Connection, Version - 2.5.3-k> port 0x2000-0x22
igb1: Using MSIX interrupts with 3 vectors
igb1: Ethernet address: **:**:**:**:**:**
igb1: Bound queue 0 to cpu 2
igb1: Bound queue 1 to cpu 3
igb1: netmap queues/slots: TX 2/1024, RX 2/1024
pcib3: <ACPI PCI-PCI bridge> irq 26 at device 2.3 on pci0
pci3: <ACPI PCI bus> on pcib3
igb2: <Intel(R) PRO/1000 Network Connection, Version - 2.5.3-k> port 0x3000-0x33
igb2: Using MSIX interrupts with 3 vectors
igb2: Ethernet address: **:**:**:**:**:**
igb2: Bound queue 0 to cpu 0
igb2: Bound queue 1 to cpu 1
igb2: netmap queues/slots: TX 2/1024, RX 2/1024
pcib4: <ACPI PCI-PCI bridge> at device 2.4 on pci0
pci4: <ACPI PCI bus> on pcib4
igb3: <Intel(R) PRO/1000 Network Connection, Version - 2.5.3-k> port 0x4000-0x44
igb3: Using MSIX interrupts with 3 vectors
igb3: Ethernet address: **:**:**:**:**:**
igb3: Bound queue 0 to cpu 2
igb3: Bound queue 1 to cpu 3
igb3: netmap queues/slots: TX 2/1024, RX 2/1024
pci0: <encrypt/decrypt> at device 8.0 (no driver attached)
xhci0: <AMD FCH USB 3.0 controller> mem 0xf7f22000-0xf7f23fff irq 18 at device 0
xhci0: 32 bytes context size, 64-bit DMA
xhci0: Unable to map MSI-X table
usbus0 on xhci0
usbus0: 5.0Gbps Super Speed USB v3.0
ahci0: <AMD Hudson-2 AHCI SATA controller> port 0x5010-0x5017,0x5020-0x5023,0x50
ahci0: AHCI v1.30 with 2 6Gbps ports, Port Multiplier supported with FBS
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
ehci0: <AMD FCH USB 2.0 controller> mem 0xf7f26000-0xf7f260ff irq 18 at device 0
usbus1: EHCI version 1.0
usbus1 on ehci0
usbus1: 480Mbps High Speed USB v2.0
isab0: <PCI-ISA bridge> at device 20.3 on pci0
isa0: <ISA bus> on isab0
sdhci_pci0: <Generic SD HCI> mem 0xf7f27000-0xf7f270ff at device 20.7 on pci0
sdhci_pci0: 1 slot(s) allocated
orm0: <ISA Option ROM> at iomem 0xef000-0xeffff on isa0
ppc0: cannot reserve I/O port range
uart0: <16550 or compatible> at port 0x3f8 irq 4 flags 0x10 on isa0
uart0: console (115200,n,8,1)
uart1: <16550 or compatible> at port 0x2f8 irq 3 on isa0
hwpstate0: <Cool'n'Quiet 2.0> on cpu0
Timecounters tick every 1.000 msec
nvme cam probe device init
ugen0.1: <0x1022 XHCI root HUB> at usbus0
ugen1.1: <AMD EHCI root HUB> at usbus1
uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
uhub1: <AMD EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
uhub0: 4 ports with 4 removable, self powered
uhub1: 2 ports with 2 removable, self powered
ugen1.2: <vendor 0x0438 product 0x7900> at usbus1
uhub2 on uhub1
uhub2: <vendor 0x0438 product 0x7900, class 9/0, rev 2.00/0.18, addr 2> on usbu1
uhub2: 4 ports with 4 removable, self powered
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <T50S2STMLC-004G OHY06A S> ATA8-ACS SATA 2.x device
ada0: Serial Number *************
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 512bytes)
ada0: 3831MB (7847280 512 byte sectors)
Trying to mount root from ufs:/dev/ufsid/**************** [rw]...
WARNING: /: TRIM flag on fs but disk does not support TRIM
Configuring crash dumps...
No suitable dump device was found.
/dev/ufsid/****************: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ufsid/****************: clean, 669160 free (4136 frags, 83128 blocks, 0.4%)
Filesystems are clean, continuing...
Mounting filesystems...
random: unblocking device.

        __
 _ __  / _|___  ___ _ __  ___  ___
| '_ \| |_/ __|/ _ \ '_ \/ __|/ _ \
| |_) |  _\__ \  __/ | | \__ \  __/
| .__/|_| |___/\___|_| |_|___/\___|
|_|


Welcome to pfSense 2.4.3-RELEASE (Patch 1)...

...ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lE
32-bit compatibility ldconfig path: /usr/lib32
done.
External config loader 1.0 is now starting... ada0s1 ada0s1a
Launching the init system...Updating CPU Microcode...
CPU: AMD GX-412TC SOC                                (998.15-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0x******  Family=0x16  Model=0x30  Stepping=1
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,>
  Features2=0x3ed8220b<SSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT>
  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
  AMD Features2=0x1d4037ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW>
  Structured Extended Features=0x8<BMI1>
  XSAVE Features=0x1<XSAVEOPT>
  SVM: NP,NRIP,AFlush,DAssist,NAsids=8
  TSC: P-state invariant, performance statistics
Done.
.... done.
Initializing.................. done.
Starting device manager (devd)...done.
Loading configuration......done.
..............................Updating configuration...done.
Checking config backups consistency...done.
Setting up extended sysctls...done.
Setting timezone...done.
Configuring loopback interface...done.
Starting syslog...done.
Starting Secure Shell Services...done.
Setting up interfaces microcode...done.
Configuring loopback interface...done.
Creating wireless clone interfaces...done.
Configuring LAGG interfaces...done.
Configuring VLAN interfaces...done.
Configuring QinQ interfaces...done.
Configuring WAN interface...done.
Configuring LAN interface...done.
Configuring CARP settings...done.
Syncing OpenVPN settings...done.
Configuring firewall......done.
Starting PFLOG...done.
Setting up gateway monitors...done.
Setting up static routes...done.
Setting up DNSs...Starting DNS Resolver...done.
done.
Synchronizing user settings...done.
Starting webConfigurator...done.
Configuring CRON...done.
Starting NTP time client...done.
Starting DHCP service...done.
Starting DHCPv6 service...done.
Configuring firewall......done.
Generating RRD graphs...done.
Starting syslog...done.
Starting CRON... done.
pfSense 2.4.3-RELEASE (Patch 1) amd64 Thu May 10 15:02:52 CDT 2018
Bootup complete
    
por 15.09.2018 / 12:12