Printer, program, and information processing system
Patent Information
- Application Number
- JP2022185417
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2025-10-14
AI Technical Summary
Printers experience communication failures when connected via LAN due to disconnections or router malfunctions, leading to communication disruptions with external devices.
The printer switches its default gateway from a LAN-connected gateway to a mobile communication network gateway when LAN communication is interrupted, allowing it to maintain connectivity with external devices through a mobile network.
Ensures continuous communication with external devices by automatically switching gateways, enabling seamless communication even during LAN failures without user intervention.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a printer, a program, and an information processing system. [Background technology]
[0002] 2. Description of the Related Art Conventionally, there is known a technique for detecting a fault in a line or device on a network and switching a communication route (Patent Document 1). [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2009-182526 A Summary of the Invention [Problem to be solved by the invention]
[0004] However, while a printer is communicating with, for example, a computer terminal via a LAN (Local Area Network), a network failure may occur due to the disconnection of the LAN cable or a malfunction of a router, resulting in a communication error such as a cutoff of communication with the computer terminal. In such a case, a problem may arise in which the printer is unable to communicate with a device (for example, a server that manages the printer) connected to an external network beyond the network to which the printer belongs.
[0005] SUMMARY OF THE PRESENT EMBODIMENT An object of the present invention is to enable a printer to communicate with another device connected to an external network when a communication error occurs with a certain device via a LAN. [Means for solving the problem]
[0006] One aspect of the present invention is a printer comprising: a communication unit that communicates with a first device via a first gateway connected to a LAN and communicates with a second device via a second gateway connected to a mobile communications network; and a control unit that controls the communication unit so as to switch the default gateway setting from the first gateway to the second gateway when communication with the first device is interrupted while communicating with the first device via the first gateway. Effect of the Invention
[0007] According to one aspect of the present invention, in the case where a communication error occurs in a printer with a certain device via a LAN, the printer is able to communicate with another device connected to an external network. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 illustrates an example of a configuration of a communication system according to an embodiment. [Diagram 2] 1 is a diagram showing a connection relationship between a printer and the Internet in a communication system according to an embodiment; [Diagram 3] FIG. 4 illustrates an example of a screen display of a printer according to an embodiment. [Figure 4] 3 is a diagram illustrating a state in which LAN communication by a printer is interrupted in the communication system shown in FIG. 2. [Diagram 5] 3 is a diagram showing a state after the default gateway of the printer is switched in the communication system shown in FIG. 2. [Figure 6] 10 is a flowchart showing a process performed when LAN communication is interrupted in a printer according to an embodiment. [Figure 7] 11A and 11B are diagrams illustrating an example of a change in the display on the screen when LAN communication is interrupted in the printer of an embodiment. [Figure 8] 3 is a diagram showing a state in which communication by a printer via a SIM in the communication system shown in FIG. 2 is interrupted. [Figure 9]11A and 11B are diagrams illustrating an example of a change in the display on the screen when communication via a SIM is interrupted in the printer of the embodiment. [Figure 10] 11 is a sequence chart showing a sequence for acquiring packet data in a LAN when LAN communication is interrupted in a communication system according to an embodiment. [Figure 11] FIG. 11 is a diagram showing an example of a screen of an administrator terminal in the communication system according to an embodiment. [Figure 12] FIG. 11 is a diagram showing an example of a packet analysis result in a communication system according to an embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] Hereinafter, an embodiment of a printer, a program, and an information processing system of the present invention will be described. Note that the embodiment described below is not limited to the drawings described in the brief description of the drawings. A first aspect of the present invention is a printer comprising: a communication unit connected to a LAN (Local Area Network) that communicates with a first device via a first gateway set as a default gateway, and that communicates with a second device via a second gateway connected to a mobile communication network; and a control unit that controls the communication unit so that, when a communication abnormality with the first device occurs while communicating with the first device via the first gateway, the default gateway setting is switched from the first gateway to the second gateway, and the printer communicates with the second device.
[0010] In this disclosure, a "LAN (Local Area Network)" may be a network of any size as long as it is a network (sub-network) that is uniquely determined by a network address. The LAN may be a wired network or a wireless network. In the case of a wireless network, it complies with standards such as IEEE802a / b / g / j / n / ac / ad. In this disclosure, a "gateway" is a physical network node in a computer network that relays data transmitted and received between different networks, such as a router, a switch, or a switching hub. A router is a device that relays data between different networks. A switch or a switching hub is a device that uses switching to connect devices on a computer network to receive data and forward the data to a destination device. In the present disclosure, the term "mobile communication network" is not particularly limited in its specifications, and is not particularly limited as long as it complies with a wireless communication system operated or to be operated by a mobile communication carrier. Examples of such wireless communication systems include a wireless communication system that complies with the IMT-Advanced standard, generally referred to as 4G, a wireless communication system that complies with the IMT-2020 standard, generally referred to as 5G, or a wireless communication system beyond 5G. In the present disclosure, the "first device" may be any device connected to a LAN, such as a computer device, a smartphone, a tablet terminal, etc. In the present disclosure, the "second device" may be any device connected to a mobile communication network, such as a computer device, a server, or the like, that can access the mobile communication network.
[0011] According to a first aspect of the present invention, in the case where a communication error occurs with a first device via a LAN, the printer is able to communicate with a second device connected to an external network.
[0012] A second aspect of the present invention is a printer described in the first aspect, wherein the control unit controls the communication unit to switch the default gateway setting from the second gateway to the first gateway when communication with the first device is restored. According to a second aspect of the present invention, when communication with the first device is restored, the default gateway setting can be automatically restored, without requiring any operation by the user.
[0013] A third aspect of the present invention is the printer according to the first or second aspect, further comprising a LAN analysis unit that analyzes packets received via the LAN. According to a third aspect of the present invention, it becomes possible to analyze the cause of an abnormality in communication via a LAN.
[0014] A fourth aspect of the present invention is a printer described in the third aspect, wherein the LAN analysis unit analyzes the packet in response to a request from the second device obtained via the mobile communications network. According to a fourth aspect of the present invention, packet analysis can be performed via the second device even while communication with the first device via the LAN is cut off.
[0015] A fifth aspect of the present invention is a printer described in any of the first to fourth aspects, wherein, when a communication abnormality occurs with the first device, the control unit controls the communication unit to restrict the communication ports that are allowed when communicating with the second device via the second gateway. According to the fifth aspect of the present invention, it is possible to improve security when communication is performed via the second gateway.
[0016] A sixth aspect of the present invention is a printer described in any of the first to fifth aspects, wherein the control unit controls the communication unit so that, when a communication abnormality occurs with the first device, a DNS (Domain Name System) server accessed to resolve a domain name is switched from a first DNS server connected to the LAN to a second DNS server connected to the mobile communication network. According to a sixth aspect of the present invention, after switching the default gateway setting from the first gateway to the second gateway, it is possible to perform domain name resolution and perform IP (Internet Protocol) communication.
[0017] A seventh aspect of the present invention is a program for controlling printer communications, which causes a computer to function as a communication means for communicating with a first device via a first gateway connected to a LAN and set as a default gateway, and for communicating with a second device via a second gateway connected to a mobile communications network, and a control means for controlling the default gateway to be switched from the first gateway to the second gateway and to communicate with the second device when a communication abnormality occurs with the first device while communicating with the first device via the first gateway. According to a seventh aspect of the present invention, in the printer, when a communication error occurs with a first device via a LAN, communication with a second device connected to an external network becomes possible.
[0018] An eighth aspect of the present invention is an information processing system including a printer and a server capable of communicating with the printer, wherein the printer has a communication unit that communicates with an information processing device via a first gateway connected to a LAN and set as a default gateway, and communicates with the server via a second gateway connected to a mobile communication network, a control unit that controls the communication unit so that, when a communication abnormality occurs with the information processing device while communicating with the information processing device via the first gateway, the default gateway setting is switched from the first gateway to the second gateway and communication with the server occurs, and a LAN analysis unit that analyzes packets received via the LAN, and the server has an analysis request unit that requests the printer to analyze the packets by the LAN analysis unit, and an acquisition unit that acquires the analysis results by the LAN analysis unit from the printer. According to an eighth aspect of the present invention, when a communication abnormality occurs in a printer with an information processing device via a LAN, the printer is able to communicate with a server connected to an external network and is able to obtain the analysis results of packets received by the printer via the LAN.
[0019] A ninth aspect of the present invention is a control method for a printer, comprising the steps of communicating with a first device via a first gateway connected to a LAN and set as a default gateway, and communicating with a second device via a second gateway connected to a mobile communications network, and, if a communication abnormality occurs with the first device while communicating with the first device via the first gateway, controlling the default gateway to be switched from the first gateway to the second gateway and to communicate with the server. According to a ninth aspect of the present invention, in the printer, when a communication error occurs with a first device via a LAN, communication with a second device connected to an external network becomes possible.
[0020] A tenth aspect of the present invention is a printer according to any one of the first to sixth aspects, which selectively displays communication settings for communication via the first gateway or communication settings for communication via the second gateway on a display unit in response to a user's operation. According to a tenth aspect of the present invention, the user can check the communication settings of the printer at any time.
[0021] Hereinafter, an embodiment will be described with reference to the drawings. FIG. 1 shows a schematic configuration of a communication system 1 (an example of an information processing system) according to an embodiment. In the communication system 1, the LAN is a network to which a gateway GW1 (an example of a first gateway), a user terminal 2, a printer 3, a DNS server 71, a DHCP server 72, etc. are connected. A proxy server, etc. may also be connected to the LAN. The gateway GW1 is, for example, configured with a router having a function of routing packets via the LAN. The gateway GW1 relays data transmitted and received between devices connected to the LAN. The printer 3 may be a stationary printer or a portable printer, and receives a print request from the user terminal 2 connected to the LAN, and issues a print medium such as a label based on the received print request. The printer 3 is, for example, a thermal printer, but is not limited to this. The user terminal 2 (an example of a first device) is, for example, an information processing device such as a computer device, a tablet terminal, a smartphone, etc. Examples of LAN communication between the user terminal 2 and the printer 3 include a case where the printer 3 sends a print request to the user terminal 2, and a case where the printer 3 sends status information to the user terminal 2.
[0022] The gateway GW1 also has a function of relaying packets via the LAN to other networks beyond the LAN (for example, the Internet IN). The DNS server 71 (an example of a first DNS server) is a server that resolves domain names. When a device in the LAN specifies a domain name, such as a URL, to communicate with an external device connected to the Internet IN, the device makes an inquiry to the DNS server 71 and acquires a destination IP address. The DHCP (Dynamic Host Configuration Protocol) server 72 provides a service of allocating (lending) information such as an IP address for a certain period of time when a device in the LAN communicates with an external device connected to the Internet IN.
[0023] A management server 5 and an administrator terminal 6 are connected to the Internet IN. The management server 5 (an example of a second device) is a server that manages the operating status of the printer 3. In the example shown in Fig. 1, only one printer 3 connected to the LAN is illustrated, but the printers that are managed by the management server 5 are not limited to this. The management server 5 can manage each of two or more printers connected to the LAN, or each of a large number of printers connected to multiple LANs.
[0024] Communication between the printer 3 and the management server 5 is performed via the Internet IN. The communication protocol between the printer 3 and the management server 5 is not limited, but may be, for example, MQTT (Message Queueing Telemetry Transport) or MQTT over WebSocket. MQTT is a lightweight Pub / Sub type data communication protocol. In order to receive a predetermined service from the management server 5, the printer 3 periodically transmits status information indicating the status of the printer 3 and setting information indicating the settings of the printer 3 to the management server 5. The management server 5 records the status information and setting information for each printer in a database. Non-limiting examples of printer status information include the total travel distance of the platen roller, the printer's operating time, the number of labels printed, and error information. Non-limiting examples of printer setting information include the platen roller travel speed, print density, information such as the type of sensor installed in the printer, and information regarding communication settings. Non-limiting examples of services provided by the management server 5 include the following. - Notifying the user terminal 2 of the operation status and load status of the printer 3 Notifying the user terminal 2 of the time to replace consumable parts of the printer 3 - Notifying the user terminal 2 of an error that occurred in the printer 3
[0025] The administrator terminal 6 is, for example, an information processing terminal such as a computer device, a tablet terminal, or a smartphone, and is a terminal operated by an administrator of the printer 3. A printer management application is installed on the administrator terminal 6. The printer management application communicates with the management server 5 via the Internet IN, and displays the status information and setting information of the printer 3 recorded in the database of the management server 5. This allows the administrator to view the information of the printer 3.
[0026] The printer 3 is configured to be able to accommodate a Subscriber Identity Module (SIM) card in order to utilize mobile communication services provided by telecommunications carriers. The SIM card installed in the printer 3 can utilize the mobile communication network MCN via a gateway GW2 (an example of a second gateway). The SIM card is an example of a user identification module that stores user identification information for managing the use of the mobile communication network MCN for each user. Other examples of user identification modules include a Universal Subscriber Identity Module (UIM) card.
[0027] A DNS server 81 (an example of a second DNS server) is connected to the mobile communication network MCN. A gateway GW3 connected to the mobile communication network MCN relays data between the mobile communication network MCN and the Internet IN. The mobile communication network MCN and the gateway GW3 are provided by a telecommunications carrier. Therefore, when communicating with the management server 5 or the administrator terminal 6, the printer 3 can send and receive data (packets) via the SIM card and the gateway GW2, rather than via the gateway GW1.
[0028] Fig. 2 is a diagram showing a communication path from the printer 3 to the Internet IN in the communication system 1 shown in Fig. 1. Fig. 2 also shows the configuration included in each device of the printer 3, the management server 5, and the administrator terminal 6. As shown in FIG. 2, in order for the printer 3 to communicate with the management server 5 or the administrator terminal 6, it must either connect to the Internet IN via a gateway GW1 connected to a LAN, or connect to the Internet IN from a SIM card (not shown) via a gateway GW2, a mobile communication network MCN, and a gateway GW3. 2, the default gateway of the printer 3 is set to the gateway GW1 in the initial state. Therefore, data sent from the printer 3 to the management server 5 outside the LAN is sent to the gateway GW1, where the domain name is resolved by the DNS server 71, and then the data is sent to the management server 5 via the Internet IN.
[0029] Next, the configurations of the printer 3, management server 5, and administrator terminal 6 included in the communication system 1 shown in FIG. 1 will be described with reference to FIG.
[0030] As shown in FIG. 2, the printer 3 includes a control unit 31, an operation input unit 32, a display unit 33, a conveyance unit 34, a printing unit 35, a storage 36, and a communication unit 37. The control unit 31 is mainly composed of a microprocessor and a memory, and controls the entire printer 3. For example, the microprocessor included in the control unit 31 loads and executes firmware recorded in the storage 36, thereby controlling the printing unit 35 to print information on a printing medium such as a label based on a printing request from the user terminal 2 obtained via the LAN. A route table is stored in the memory of the control unit 31. The control unit 31 executes processing for a communication abnormality in the LAN (described later with reference to FIG. 6). When a communication abnormality occurs with the user terminal 2 during communication with the user terminal 2 via the gateway GW1, the control unit 31 controls the communication unit 37 to switch the default gateway setting from the gateway GW1 to the gateway GW2 and communicate with the management server 5. The control unit 31 controls the communication unit 37 so that when communication with the user terminal 2 is interrupted, the DNS server to be accessed for domain name resolution is switched from the DNS server 71 connected to the LAN to the DNS server 81 connected to the mobile communication network MCN.
[0031] As will be described later, in one embodiment, the above-mentioned LAN analyzer (one example of a LAN analysis unit) is incorporated into the control unit 31 as a part of the firmware functions. The LAN analyzer analyzes packets received from the communication unit 37 via the LAN. Based on the analysis file obtained by the LAN analyzer, it becomes possible to analyze the cause of communication via the LAN being cut off. The start and stop of packet analysis by the LAN analyzer are controlled by commands received from the management server 5 via the communication unit 37 through a mobile communication network or the like.
[0032] The operation input unit 32 includes an input device such as a button or a touch input device mounted on the display panel of the display unit 23, and accepts operation input by a user. The display unit 33 includes a display panel such as an LCD and a display drive circuit, and displays the execution result of the firmware. The transport unit 34 includes a platen roller, a motor drive circuit, and a stepping motor (not shown), and transports print media such as labels within the printer 3. The printing unit 35 includes a thermal head and a head drive circuit (not shown), and performs printing by selectively passing current through a plurality of heating elements of the thermal head in response to a print request.
[0033] The storage 36 is a non-volatile memory, for example, a solid state drive (SSD) such as a flash memory. For example, an analysis file obtained by a LAN analyzer is recorded in the storage 36. The storage 36 also stores a route table.
[0034] The communication unit 37 communicates with external devices connected to the LAN, such as the user terminal 2, via a gateway GW1 connected to the LAN. That is, the communication unit 37 receives or transmits packets via the LAN under the control of the control unit 31.
[0035] The communication unit 37 communicates with the management server 5 or the administrator terminal 6 via the Internet IN through a gateway GW2 connected to the mobile communication network MCN. For example, the communication unit 37 includes a communication circuit for connecting to the mobile communication network MCN via a SIM card or the like, an antenna, and a slot into which, for example, a SIM card can be inserted. In one embodiment, under the control of the control unit 31, the communication unit 37 transmits the status information of the printer 3 and the setting information of the printer 3 to the management server 5, for example, periodically. The timing of transmitting the status information is not particularly limited, but for example, is a predetermined timing between 10 and 30 minutes (for example, at 15 minute intervals). The timing of transmitting the setting information is not particularly limited, but for example, is the timing when an event occurs to change the settings of the printer 3. The communication protocol used in the communication between the communication unit 37 and the management server 5 is not limited, but may be, for example, MQTT or MQTT over WebSocket.
[0036] As shown in FIG. 2, the management server 5 includes a control unit 51, a storage unit 52, and a communication unit 53. The control unit 51 is mainly composed of a microprocessor and a memory, and controls the entire management server 5. For example, the microprocessor included in the control unit 51 executes a management program to obtain status information and setting information for each of the multiple printers 3 to be managed from the printers 3, and appropriately updates a printer management database (not shown). The printer management database is a database for storing status information and setting information for each of the multiple printers 3. The control unit 51 functions as an analysis request unit that requests the printer 3 to analyze a packet by a LAN analyzer, and as an acquisition unit that acquires the analysis result (analysis file) by the LAN analyzer from the printer 3. In one embodiment, the control unit 51 stores the analysis file acquired from the printer 3 in the storage 52 . The storage 52 is a large-scale storage device such as a hard disk drive (HDD), and stores a printer management database and analysis files. The communication unit 53 is a communication interface for communicating with the printer 3 and the administrator terminal 6.
[0037] As shown in FIG. 2, the administrator terminal 6 centrally manages the status information and setting information of the multiple printers 3, and includes a control unit 61, an operation input unit 62, a display unit 63, and a communication unit 64. The control unit 61 is mainly composed of a microprocessor and a memory, and controls the entire administrator terminal 6. For example, the microprocessor included in the control unit 61 executes a printer management application. When an administrator or the like performs a predetermined operation on the printer management application, the printer management application causes the display unit 63 to display status information and setting information for a specific printer 3, or an analysis file obtained by the specific printer 3. This makes it easier for the administrator or the like to identify the cause of a malfunction in, for example, a printer 3 that has malfunctioned, thereby supporting the user of the printer 3. The operation input unit 62 includes an input device such as a mouse and / or a keyboard, or a touch input device mounted on the display panel of the display unit 63, and accepts operation input by a user. The display unit 63 includes a display panel such as an LCD and a display drive circuit, and displays the execution result of the printer management application. The communication unit 64 is a communication interface for communicating with the printer 3 and the management server 5. The communication protocol used in the communication between the communication unit 64 and the management server 5 is not limited, but is, for example, HTTPS.
[0038] As described above, in one embodiment, the display unit 33 of the printer 3 is equipped with a touch panel type screen. A user of the printer 3 can check the communication settings of the printer 3 by operating buttons on the screen. Fig. 3 shows an example of a screen display of the LAN side communication settings and the SIM side communication settings in the printer 3 of one embodiment. When using a LAN, the user of the printer 3 can select either DHCP or a fixed address. Screen G1 in Fig. 3 shows an example of the LAN side communication setting screen when DHCP is selected, and screen G2 in Fig. 3 shows an example of the LAN side communication setting screen when a fixed address is selected. Screen G3 in Fig. 3 shows an example of the SIM side communication setting screen. In the LAN side communication settings in Figure 3, the "Gateway" item indicates the IP address of the default gateway (i.e., the IP address of gateway GW1), and the "DNS" item indicates the IP address of the DNS server. In the SIM side communication settings in Figure 3, the "Next hop" item indicates the IP address of the packet forwarding destination (i.e., the IP address of gateway GW2). As shown in Figure 2, in the communication settings on the SIM side, the static route is fixed to "0.0.0.0" and cannot be changed by the user, so it is not included in the items on screen G3.
[0039] Next, assume that a communication error occurs with the user terminal 2 while the communication unit 37 of the printer 3 is communicating with the user terminal 2 via the gateway GW1. Possible causes of the communication error with the user terminal 2 include, for example, the removal of the LAN cable from the printer 3 or a failure in the gateway GW1. Compared to FIG. 2, FIG. 4 shows a state in which communication between the printer 3 and the gateway GW1 is interrupted. When a communication error occurs with the user terminal 2 during communication with the user terminal 2 via the gateway GW1, the control unit 31 of the printer 3 controls the communication unit 37 to change the default gateway setting from the gateway GW1 to the gateway GW2 in order to ensure communication with the Internet IN. Fig. 5 shows the communication path from the printer 3 to the Internet IN when the default gateway setting is changed to the gateway GW2.
[0040] Below, with reference to Figures 6 and 7, we will explain the processing of the control unit 31 of the printer 3 when the communication unit 37 of the printer 3 is communicating with the user terminal 2 via the gateway GW1 and is connected to the management server 5 via a SIM and LAN communication is interrupted due to a LAN communication abnormality. Fig. 6 is a flow chart showing processing when LAN communication is interrupted in the printer 3. Fig. 7 is a diagram showing an example of a change in display of a communication setting screen in the printer 3 when LAN communication is interrupted in the printer 3. Note that in Fig. 7, a screen G1 before LAN communication is interrupted is the same as the screen G1 in Fig. 3. In Fig. 7, a communication setting screen G3 on the SIM side after LAN communication is interrupted is the same as the screen G3 in Fig. 3.
[0041] When the control unit 31 of the printer 3 detects a cutoff of the LAN communication (step S2: YES), it updates the route table in the storage 36 (step S4). In the route table, a default gateway is written as the gateway to which the packet is first forwarded. As shown in Fig. 7, after the LAN communication is cut off, the communication setting on the LAN side becomes screen G1a. As shown in screen G1a, the default gateway setting becomes "0.0.0.0", and the DNS server 71 on the LAN side cannot be used, so in step S4, the printer 3 updates the route table in the storage 36 by switching the default gateway setting from gateway GW1 to gateway GW2. Even after the LAN communication is cut off, if the session is not cut off, the communication with the management server 5 can be continued through the static route on the SIM side. However, the HTTPS communication session is temporary, and the session may be cut off depending on the radio wave conditions. In that case, the DNS server 71 on the LAN side cannot resolve the domain name. Therefore, the control unit 31 of the printer 3 switches the default gateway from the gateway GW1 to the gateway GW2. Furthermore, the printer 3 updates the DNS server settings so that the DNS server 81 on the mobile communication network MCN side is used instead of the DNS server 71 on the LAN side (step S6). This enables the printer 3 to communicate with the management server 5 and the administrator terminal 6 connected to the external Internet IN when communication with the user terminal 2 via the LAN is interrupted.
[0042] When the control unit 31 of the printer 3 detects the recovery of the LAN communication (step S8: YES), it updates the route table in the storage 36 by switching the default gateway setting from the gateway GW2 to the gateway GW1 (step S10). Furthermore, the control unit 31 of the printer 3 updates the DNS server setting so that the DNS server 71 on the LAN side is used instead of the DNS server 81 on the mobile communication network MCN side (step S12). In other words, when the communication with the user terminal 2 via the LAN is recovered, the default gateway setting is automatically restored without the need for user operation, and it becomes possible to communicate with the management server 5 and the administrator terminal 6 connected to the external Internet IN via the gateway GW1.
[0043] The process of the flowchart in Fig. 6 is limited to the case where the communication setting on the LAN side is DHCP. If the communication setting on the LAN side is a fixed address and the LAN communication is interrupted, the communication on the SIM side cannot refer to the DNS server after the session is terminated and cannot resolve the domain name, so the control unit 31 of the printer 3 disconnects the connection to the management server 5 using, for example, MQTT / MQTT over WebSocket. Then, after the communication on the LAN is restored, an attempt is made to reconnect to the management server 5 using MQTT / MQTT over WebSocket.
[0044] Next, assume that a communication error occurs with the management server 5 while the communication unit 37 of the printer 3 is communicating with the management server 5 via the gateway GW2. The cause of the communication error with the management server 5 may be, for example, removal of the SIM card from the printer 3. Compared to FIG. 2, FIG. 8 shows a state in which communication between the printer 3 and the gateway GW2 is interrupted. If communication with, for example, a management server 5 is interrupted while the control unit 31 of the printer 3 is communicating with the management server 5 via the gateway GW2, the control unit 31 changes the default gateway setting from the gateway GW2 to the gateway GW1 in order to ensure communication with the Internet IN.
[0045] 9 is a diagram showing an example of a change in the display of the SIM-side communication settings screen of the printer 3 when communication by the printer 3 via the SIM is interrupted. In FIG. 9, the screen G3 before communication via the SIM is interrupted is the same as the screen G3 in FIG. 3. After communication via the SIM is interrupted, the SIM-side communication settings become screen G3a. As shown in screen G3a, the next hop and DNS settings are cleared to "0.0.0.0". When the SIM card is reinserted and communication via the SIM becomes possible, the SIM-side communication settings return from screen G3a to screen G3. When the SIM card is reinserted, the SIM side IP address, next hop (gateway GW2), and DNS server settings are assigned again by the DHCP server 72.
[0046] As described above, the printer 3 of this embodiment includes a communication unit 37 that communicates with the user terminal 2 via the gateway GW1 connected to the LAN and communicates with the management server 5 via the gateway GW2 connected to the mobile communication network MCN. The control unit 31 of the printer 3 controls the communication unit 37 to switch the default gateway setting from the gateway GW1 to the gateway GW2 when communication with the user terminal 2 is interrupted during communication with the user terminal 2 via the gateway GW1. Therefore, when communication with the user terminal 2 via the LAN is interrupted, the printer 3 becomes able to communicate with the management server 5 connected to an external network.
[0047] Next, an embodiment of the process performed by the printer 3 when LAN communication is interrupted due to a LAN communication abnormality will be described. Referring to Figure 6, the processing of the printer 3 when LAN communication is interrupted due to a LAN communication abnormality is shown. This processing ensures a communication path with the management server 5 and the administrator terminal 6 via SIM, so that the cause of the LAN communication interruption can be identified via this communication path. Hereinafter, the process of the printer 3 when the LAN communication is interrupted in one embodiment will be described with reference to the sequence chart shown in Fig. 10. In Fig. 10, it is assumed that the printer 3 periodically communicates with the management server 5 (for example, transmits status information and setting information) via the gateway GW1 by MQTT before the LAN communication is interrupted.
[0048] 10, for example, when an attempt is made to print a label from the printer 3 but communication with the printer 3 is not possible, the user terminal 2 displays a message indicating that communication is not possible (step S21). The user terminal 2 then transmits a message indicating that a malfunction has occurred to the administrator terminal 6 (step S22). The message in step S22 may be transmitted by a printer management application if one is installed in the user terminal 2, or may be transmitted by e-mail, for example. Instead of step S22, the user may inform the administrator of the malfunction by telephone.
[0049] The control unit 61 of the administrator terminal 6 accepts a specified operation from the operation input unit 62 for the administrator to remotely operate the LAN analyzer of the printer 3 to analyze the communication status in the LAN of the printer 3 on the screen displayed by the printer management application (step S24). 11 shows screen G5, an example of a screen displayed by the printer management application of the administrator terminal 6. Screen G5 includes a tab group 100 including multiple tabs, buttons b1 and b2, a text box bx1, and an analysis file list 102. A remote operation to the LAN analyzer of the printer 3 is accepted by operating button b1. Note that, for a remote operation to the LAN analyzer, the port number to be analyzed can be specified by inputting the port number in text box bx1. In response to the operation reception in step S24, the control unit 61 of the administrator terminal 6 transmits, for example, a packet analysis start request to the management server 5 by the printer management application via the communication unit 64. The control unit 51 of the management server 5 transmits an MQTT message corresponding to the packet analysis start request to the printer 3 via the communication unit 53 (step S26). The LAN analyzer of the printer 3 interprets, for example, the received MQTT message and starts analyzing the packet received from the LAN (step S28). That is, the LAN analyzer analyzes the packet in response to the request from the management server 5 obtained via the mobile communication network MCN.
[0050] It is assumed that the LAN analyzer is already running when the MQTT message is received in step S26. If the LAN analyzer is not running, the packets cannot be analyzed, but by starting the LAN analyzer after communication with the LAN is restored, the packets can be analyzed when communication with the LAN is cut off again. If communication with the LAN is frequently cut off, the LAN analyzer may be started in advance.
[0051] Here, when the control unit 31 of the printer 3 detects a cutoff of LAN communication (step S30), it updates the route table and changes the default gateway setting from gateway GW1 to gateway GW2 (step S32). Furthermore, the control unit 31 of the printer 3 updates the MQTT connection with the management server 5 (step S34). In updating the MQTT connection, the DNS server setting is updated from the DNS server 71 on the LAN side to the DNS server 81 on the mobile communication network MCN side. Note that the processes of steps S30 to S34 are the same as the processes of steps S2 to S6 in FIG. 6, respectively.
[0052] When the time required to analyze the communication status in the LAN of the printer 3 has elapsed, the control unit 61 of the administrator terminal 6 sends a packet analysis stop request to the management server 5 in response to the operation of button b2 (see FIG. 11) by the administrator on the screen displayed on the administrator terminal 6 by the printer management application. The control unit 51 of the management server 5 sends an MQTT message corresponding to the packet analysis stop request to the printer 3 via the communication unit 53, for example, by connecting to the mobile communication network MCN via a SIM or the like (step S36). The control unit 31 of the printer 3 interprets the MQTT message received in step S36 and controls the LAN analyzer to stop analyzing packets received from the LAN. Next, the control unit 61 of the administrator terminal 6 transmits an analysis file upload request via the communication unit 64 to the printer 3 via the management server 5. The LAN analyzer of the printer 3 compresses and encrypts the analysis file indicating the packet analysis results (step S40) and transmits it to the management server 5 (step S42). Even if a failure occurs in communication via the LAN, the printer 3 can transmit the analysis file to the management server 5 by connecting to the mobile communication network MCN via the gateway GW2. The management server 5 stores the received analysis file in association with the identification information of the printer 3 that sent the file.
[0053] When the control unit 61 of the administrator terminal 6 accepts a predetermined operation by the administrator on the printer management application to specify the analysis file, it requests the analysis file from the management server 5, acquires it, and displays the analysis file on the display unit 63. On screen G5 in Fig. 11, the acquired analysis file is displayed in the analysis file list 102. The printer management application starts up a network analyzer in response to the predetermined operation specifying the analysis file in the analysis file list 102, decrypts and decompresses the analysis file (step S44), and displays the analysis file in a format that is easy for the administrator to analyze (step S46).
[0054] FIG. 12 shows an example of the analysis file displayed in step S46. The screen example shown in Fig. 12 includes a summary display section 201 and a detail display section 202. The summary display section 201 is a section showing a summary of one or more captured packets, with each line corresponding to one packet. Each line includes data such as the packet capture time (Time), source IP address (Source), destination IP address (Destination), protocol (Protocol), data length (Length), and summary information (Info). By referring to the screen shown in Fig. 12, for example, when a communication error occurs, such as the printer 3 being unable to communicate with the user terminal 2 via a LAN, an administrator or the like can analyze and solve the cause of the communication error. At this time, the control unit 51 of the management server 5 may automatically determine whether or not there is a communication abnormality caused by the LAN based on the analysis file acquired from the printer 3, and may request the printer 3 to change the settings of the communication protocol based on the determination result. For example, when the control unit 51 of the management server 5 identifies an error state or the like that is previously associated with the setting information and status information acquired from the printer 3, it may issue an analysis request related to the identified error state to the LAN analyzer of the printer 3. The management server 5 may refer to a determination table that is previously associated with the status command, etc., the printer setting information, and the status information, and when it identifies a communication error caused by the LAN that is associated with the status command extracted from the analysis packet and the setting information and status information acquired from the printer, it may issue a request to the printer 3 to change the settings of the communication protocol in correspondence with the identified communication error.
[0055] In one embodiment, the control unit 31 of the printer 3 controls the communication unit 37 to restrict the communication ports that are permitted when communicating with the management server 5 via the gateway GW2 in order to increase the security of the communication when LAN communication is interrupted. When communication is performed via the gateway GW2, the printer 3 can be protected from threats to external access by prohibiting the use of communication ports unrelated to communication with the management server 5 or the administrator terminal 6. In one embodiment, the communication ports permitted when communication is performed via the gateway GW2 are 8883 (MQTT), 443 (HTTPS or MQTT over WebSocket), and 53 (DNS).
[0056] Although an embodiment of the printer, program, and information processing system of the present invention has been described in detail above, the present invention is not limited to the above embodiment. Furthermore, the above embodiment can be improved or modified in various ways without departing from the spirit of the present invention. [Explanation of symbols]
[0057] 1. Communication systems 3. Printer 31...Control unit 32...Operation input section 33...Display section 34...Transportation section 35…Printing section 36…Storage 37…Communications Department 5…Administration server 51...Control unit 52...Storage section 53…Communications Department 6. Administrator terminal 61...Control unit 62...Operation input section 63...Display section 64…Communications Department 71...DNS server 72...DHCP server 81...DNS server 100...Tab group 102...Analysis file list 201…Summary display section 202...Details display area IN…Internet GW (GW~GW3)…Gateway MCN: Mobile communication network
Claims
1. a communication unit that is connected to a LAN (Local Area Network) and communicates with a first device via a first gateway that is set as a default gateway, and that communicates with a second device via a second gateway that is connected to a mobile communication network; a control unit that controls the communication unit to switch the default gateway setting from the first gateway to the second gateway and communicate with the second device when a communication abnormality occurs with the first device during communication with the first device via the first gateway; A printer equipped with
2. the control unit controls the communication unit to switch the setting of the default gateway from the second gateway to the first gateway when communication with the first device is restored. The printer according to claim 1 .
3. A LAN analysis unit is provided to analyze packets received via the LAN.
3. The printer according to claim 1 or 2.
4. the LAN analysis unit analyzes the packet in response to a request from the second device obtained via the mobile communication network.
4. The printer according to claim 3.
5. When communication with the first device is interrupted, the control unit controls the communication unit to restrict communication ports that are permitted when communicating with the second device via the second gateway.
3. The printer according to claim 1 or 2.
6. the control unit controls the communication unit so that, when communication with the first device is interrupted, a DNS (Domain Name System) server to be accessed for domain name resolution is switched from a first DNS server connected to the LAN to a second DNS server connected to the mobile communication network.
3. The printer according to claim 1 or 2.
7. A program for controlling printer communication, Computer, a communication means connected to a LAN (Local Area Network) and configured to communicate with a first device via a first gateway having a default gateway set thereto, and to communicate with a second device via a second gateway connected to a mobile communication network; and a control means for controlling, when a communication abnormality occurs with the first device during communication with the first device via the first gateway, switching the setting of the default gateway from the first gateway to the second gateway so as to communicate with the second device; A program to function as a
8. An information processing system including a printer and a server capable of communicating with the printer, The printer a communication unit that is connected to a LAN (Local Area Network) and communicates with the information processing device via a first gateway that is set as a default gateway, and that communicates with the server via a second gateway that is connected to a mobile communication network; a control unit that controls the communication unit to switch a setting of the default gateway from the first gateway to the second gateway and communicate with the server when a communication abnormality occurs with the information processing device during communication with the information processing device via the first gateway; a LAN analysis unit that analyzes packets received via the LAN, The server an analysis request unit that requests the printer to analyze a packet using the LAN analysis unit; an acquisition unit that acquires the analysis result by the LAN analysis unit from the printer, Information processing system.